Perforce Public Knowledge Base - Log File Rotation
× PRODUCTS SOLUTIONS CUSTOMERS LEARN SUPPORT
Downloads Company Partners Careers Contact Free Trials
Menu Search
Perforce
Reset Search
 

 

Article

Log File Rotation

« Go Back

Information

 
Problem

How do I keep my log file from getting too large?

Solution
The Perforce Server log file continually grows until it has rotated. The rate of log file growth can be rapid, particularly when verbose server logging is enabled. The log file can be renamed to prevent if from growing to an unmanagable size. The following sections provide information on handling of the Perforce Server log file based on server version.
 

Server Versions 2003.1 and Later

As of server version 2003.1, the server does not hold the log file open between updates. Use any standard batch file or script to move or rename the current log file and a new log file will be created as needed.

Server Versions 2002.2 and Earlier

Early versions of Perforce held the log file open between updates. The Perforce Server (or service, on Windows) must be stopped prior to renaming, moving or deleting the log file.

Log Rotation Utilities

Cronolog

On UNIX/Linux, the cronolog utility can be used to enable log rotation without the need to stop the server. This utility reads log file entries from standard input and selects an output file based on the current time. To use it, start P4D without the -L flag and pipe STDERR to cronolog. For example, in "sh" (shell) syntax:
 
p4d your_usual_args 2>&1 | cronolog /p4root/log.%Y_%m_%d


Note: Perforce does not support cronolog; use it at your own risk.
 

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255