[Previous] [Contents] [Index] [Next]

sloginfo

Print messages from the system log

Syntax:

sloginfo [options] [filename]

Options:

-c
Clear the log buffer after displaying all waiting messages.
-h
Print unformatted entries in hexadecimal. By default, they're printed in decimal.
-m code
Display messages with this major code (default: display all).
-s 0..7
Display messages with this severity or lower (default: 7). The lowest severity is 7 and the highest is 0.
-w
Wait for more messages to arrive.
filename
The name of the file containing raw messages (default: /dev/slog).

Description:

The sloginfo utility prints the contents of the system log buffer managed by slogger, which must be running to record these messages.

By default, sloginfo prints all messages and exits. You can use the -w option to have it wait for more messages.

You can use the -m and -s options to filter the messages to print. There are 16 million major codes, with 4096 minor codes for each major code. Selecting a major code displays messages with any of the minor codes for the specified major code. You can use the major codes to display messages for a specific area, such as TCP/IP. The major codes are defined in the file /usr/include/sys/slogcodes.h.

If a filename is specified, sloginfo takes its input from that file instead of /dev/slog. It's assumed that the file contains raw system log data saved by a program or is the file specified in the -l option to slogger.

Examples:

Print out all system log messages and exit:

sloginfo

Print out all system log messages and wait for more to arrive, printing them as they do:

sloginfo -w

Print out all system log messages, clear the log, and exit:

sloginfo -c

Display only system log messages with a severity of 0, 1, 2, 3, or 4:

sloginfo -s 4

Display the system log messages stored in a specific file:

sloginfo /var/logs/slog0

Files:

/dev/slog
The default system log file.

See also:

slogger

slogb(), slogf(), slogi(), vslogf() in the Library Reference


[Previous] [Contents] [Index] [Next]