p4 logappend

Add a line to any user log 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 may 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 Server. See the Example below.

  • To insert a placeholder, observation, or question for later investigation. For example, "Slow server now. Is a large checkin 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

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

$ p4 -zprog=mytool logappend -a error "too many links" 123

Search the log by using the p4 logparse command:

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

... 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