Logging
Overview
P4 Server provides multiple logging options to help administrators monitor server activity, troubleshoot issues, audit user access, and analyze server performance.
The available logging types are:
-
Standard log (
P4LOG) - Records server events and errors in a human-readable format. -
Audit log (
P4AUDIT) - Records user access to archive files for auditing and compliance purposes. -
Structured logs - Record detailed operational and performance data in a machine-readable format suitable for reporting, monitoring, and observability tools.
Choose the logging mechanism that best meets your operational, auditing, and monitoring requirements.
Standard log
By default, P4 Server records server events and errors in the standard log file. The location of the standard log can be changed with the P4LOG environment variable. The standard log is designed to be human readable. To learn more, see Using P4LOG.
P4AUDIT log
If the P4AUDIT environment variable is set, the audit log records each instance of a user accessing an archive file Versioned files that users submitted to a depot. with a command such as p4 sync or p4 diff. To learn more, see Auditing user file access.
Structured logs
Unlike the standard log, structured logs record detailed operational and performance data in a machine-readable format, such as .csv. Structured logs are intended for analysis using reporting, monitoring, and observability tools.
Starting in 2024.2, structured log data can be exported using OpenTelemetry through the p4 logexport command, enabling integration with observability platforms.
To learn more about configuring and using structured logs, see Structured logs.
In this section: