P4LOG
Name and path of the log P4 Server supports the standard log, which is human-readable, as well as structured logs in a comma-separated value (CSV) format. The P4LOG environment variable specifies the log file for events, including errors. The human-readable P4AUDIT environment variable specifies the log file that records file transfers to users. Structured log files are typically processed by external tools. To learn more, see 'Logging" in P4 Server Administration Documentation. file to which P4 Server events are written.
Usage notes
Used by Client? | Used by Server? | Command-Line Alternative | Can be set in P4CONFIG file? |
---|---|---|---|
No |
Yes |
|
N/A |
Value if not explicitly set
Operating System | Value |
---|---|
All |
Standard error |
Examples
log
/disk2/perforce/log
Notes
By default, the location of the log
file is in the P4ROOT
directory for Windows and in the /opt/perforce/servers/server-instance/logs/
directory for a Linux package installation.
If an absolute path and file name is not provided, the log file will be located relative to the P4ROOT
directory.
If P4 Server is running, you can find its location by using the command:p4 configure show P4LOG
If you are on Windows and the server is not running, check for P4LOG
in the output of: p4 set -S Perforce P4LOG
where Perforce
represents the name of the service that is associated with the P4 Server.
Logging commands
See the list of Logging commands in the P4 Server Administration Documentation.
Manage log file growth
On any active server, log files might grow quickly. See Manage log file growth in the P4 Server Administration Documentation.
Memory used by command and process
2022.2 release and later: The server log files include an estimate of the memory used by the server to process a command. Tracking output in the P4LOG
log file includes output that approximates the number of megabytes of committed, touched memory used by a command.
For example,
--- memory cmd/proc 6mb/10mb
.
where
-
the
cmd
portion indicates the command used 6 megabytes, and -
the
proc
portion indicates that the process or thread had a peak usage of 10 megabytes. Peak usage is relevant when multiple commands are run on the same connection.
See also "command-end" in Using structured logging in the P4 Server Administration Documentation.
Paused state
Logs include the amount of time a command has spent in the paused state. See also p4 monitor pause
Tracking output in the P4LOG
log file shows lines such as
--- paused $seconds
Version 56 of the 'CommandEnd' event (1.56) in the structured logs has a new field that represents the same data.
Server-to-server network usage on replicas
2022.2 release and later: The track output in server log files has been expanded to include network data for upstream server-to-server communication, such as edge server to commit server. Prior to 2022.2, server log files only tracked the network data for the client or downstream server. The upstream server-to-server communication is recorded as additional rpc
lines.
To learn more, see the examples and explanation at "Server-to-server network usage on replicas" under Using P4LOG in the P4 Server Administration Documentation.