p4 logappend

Add a line to any user log Helix Core Server supports human-readable logs as well as structured logs in a comma-separated value (CSV) format. The human-readable P4LOG environment variable specifies the log file for errors. The human-readable P4AUDIT environment variable specifies the log file that records file transfers to users. Structured log files are for many purposes. To learn more, see 'Logging" in Helix Core Server Administration Documentation. files.

Syntax

p4 [g-opts] logappend -a args ...

Syntax conventions

Description

The p4 logappend command appends a line to any structured log file that includes user log events. At least one argument is required, and up to 25 arguments can be supplied per line.

Use cases:

  • To enable custom or third party tools or scripts report status or error conditions into logs associated with the Helix Core Server. See the Example of log error below.

  • To insert a placeholder, observation, or question for later investigation. For example, "Slow server now. Is a large submit operation being processed?"

Options

-a args...

At least one argument is required, and up to 25 arguments to be appended to the user log. See the Example below.

g-opts

See Global options.

Usage notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

N/A

N/A

  • list
  • The two log files that include user log events are user.csv and all.csv.

Example of log error

Suppose you have tool named mytool that interacts with Helix Core Server to log errors centrally on the Helix Core Server:

Search the log by using the p4 logparse command:

p4 logparse -F 'f_prog=mytool f_args=links' user.csv

The output might contain an entry like line 13,
p4 -zprog=mytool logappend -a error "too many links" 123:

Copy
... f_eventtype 10
... f_timestamp 1511883486
... f_timestamp2 174298000
... f_date 2017/11/28 07:38:06 174298000
... f_pid 68580
... f_cmdno 1
... f_user bruno
... f_client bruno_ws
... f_func user-logappend
... f_host 127.0.0.1
... f_prog mytool
... f_version 2017.1.PREP-TEST_ONLY/DARWIN90X86_64/1505513
... f_args -a:error:too many links:123
... f_arg_1 error
... f_arg_2 too many links
... f_arg_3 123
... f_lognum 0
... f_logfile user.csv
... f_offset 1339