Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Documentation | 2025.2

# p4 logappend

Add a line to any user 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. files.

## Syntax

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

Syntax and naming 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 P4 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

Option | Description
--- | ---
`-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` This command is available to an operator (see Types of users in p4 user)

- 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 P4 Server to log errors centrally on the P4 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

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ... 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

Your search for returned results