[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 3

logger Command

Purpose

Makes entries in the system log.

Syntax

logger [ -f File ] [ -i ] [ -p Priority ] [ -t Tag ] [ Message ]

Description

The logger command provides an interface to the syslog subroutine, which writes entries to the system log. A Message variable can be specified on the command line, which is logged immediately, or a File variable is read and each line of the File variable is logged. If you specify no flags or variables, the logger command will wait for you to enter a message from standard input.

Flags

-f File Logs the specified File variable. If the Message variable is specified, this flag is ignored.
-i Logs the process ID of the logger process with each line.
-p Priority Enters the message with the specified priority. The Priority parameter may be a number or a facility.level priority specifier.
-t Tag Marks every line in the log with the specified Tag parameter.
Message Indicates the message to log. If this variable is not specified, the logger command logs either standard input or the file specified with the -f File flag.

Examples

  1. To log a message indicating a system reboot, enter:
    logger System rebooted
  2. To log a message contained in the /tmp/msg1 file, enter:
    logger -f /tmp/msg1
  3. To log the daemon facility critical level messages, enter:
    logger -pdaemon.crit

Exit Status

This command returns the following exit values:

0 Successful completion.
>0 An error occurred.

Files

/usr/bin/logger Contains the logger command.

Related Information

The syslogd daemon.

The syslog subroutine.


[ Previous | Next | Contents | Glossary | Home | Search ]