p4 logappend
Add a line to any user log files.
Syntax
p4 [g-opts] logappend -a args...
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 below.
- To insert a placeholder, observation, or question for later investigation. For example, "Slow server now. Is a large checkin being processed?"
Options
|
At least one argument is required, and up to 25 arguments to be appended to the |
|
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 |
|
- The two log files that include user log events are
user.csv
andall.csv
.
Example
Suppose you have tool named mytool
that interacts with Helix Core Server to log errors centrally on the Helix Core 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