p4 logtail

Synopsis

Display the last block(s) of the error log.

Syntax

p4 [g-opts] logtail [-b blocksize] [-s start_offset [-m maxBlocks]] [-l log]

Description

The p4 logtail command displays the last block(s) of the error log, and the offset for the next block, when available.

Output consists of a series of lines in tagged format. The first line is "... file LOG", followed by multiple blocks of log data. By default, all blocks from the start_offset are output until the end of the file. The data is returned in blocks of size blocksize, each of which is tagged with "... data". The last line is "... offsetnext_offset", where next_offset is the offset in the logfile from which the next block of data is to be retrieved.

If you specify the name of an error log that has an associated counter, the p4 logtail command returns the current value of that counter. It also returns the current size of the log, at the end of the output (along with the ending offset in the log). The size and offset are the same if the command reads to the end of the log. For more information about counters, see "Logging and structured files" in the chapter "Administering Perforce: Superuser Tasks" in the Helix Versioning Engine Administrator Guide: Fundamentals.

Options

-b blocksize

The block size, in bytes. The default is 8192 bytes.

-l log

If specified, the name of the log to display.

-m maxBlocks

The maximum number of blocks to output. Ignored unless -s is also specified.

-s start

The offset (from the beginning of the file), in bytes.

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

super

Examples

p4 logtail -b 1024 -m 2

Display the last two kilobytes of the log file, as two separate blocks of 1,024 bytes each.