Content-type: text/html Man page of logger

logger

Section: User Commands (1)
Index Return to Main Contents
 

NAME

logger - Makes entries in the system log  

SYNOPSIS

/usr/bin/logger [-f file] [-i] [-p[facility.]priority] [-t tag] [message...]

logger [-b] [message...]


 

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows:

logger:  XPG4, XPG4-UNIX

Refer to the standards(5) reference page for more information about industry standards and associated tags.
 

OPTIONS

[Compaq]  Logs the informational message to the binary event logger instead of the syslog() subroutine and enters information in the binary event log file. The uerf command with the -r 250 option reports the informational messages that are in the binary event log file, which is used for system maintenance and troubleshooting. The -b option cannot be used with any other options. [Compaq]  Logs all lines in file. [Compaq]  Logs the process ID (PID) of the logger process with each line. [Compaq]  Enters the message with the specified priority and, if specified, from the specified facility.

[Compaq]  You can specify priority as either an alphabetic string or its integer equivalent. You can specify the following values for the priority variable: [Compaq]  (0) [Compaq]  The system is unusable. (0) [Compaq]  Action must be taken immediately. (1) [Compaq]  Critical conditions. (2) [Compaq]  Error conditions. (3) [Compaq]  (3) [Compaq]  (4) [Compaq]  Warning conditions. (4) [Compaq]  Normal but significant condition. (5) [Compaq]  Informational. (6) [Compaq]  Debug-level messages. (7)
[Compaq]  You can also specify a value for the facility variable, which indicates the source of the event. You can specify facility as either an alphabetic string or its integer equivalent. The integer values appear in parentheses. You can specify the following values for the facility variable: [Compaq]  Kernel messages. (0) [Compaq]  Random user-level messages. (8) [Compaq]  Mail system. (16) [Compaq]  System daemons. (24) [Compaq]  Security/authorization messages. (32) [Compaq]  (32) [Compaq]  Messages syslogd generates internally. (40) [Compaq]  Line printer subsystem. (48) [Compaq]  Network news subsystem. (56) [Compaq]  UUCP subsystem. (64) [Compaq]  Clock daemon. (72) [Compaq]  (128) [Compaq]  (136) [Compaq]  (144) [Compaq]  (152) [Compaq]  (160) [Compaq]  (168) [Compaq]  (176) [Compaq]  (184) [Compaq]  Precedes each entry in the log with tag.
 

OPERANDS

You can specify the message to be used for entries on the command line or with the -f file option, which specifies that each line in file be logged as an entry. If you do not specify message or -f, logger reads standard input.
 

DESCRIPTION

The logger command makes the specified entries in the system log file.

The logger command provides a program and shell script interface to the syslog() subroutine. The file in which entries are made depends on the current system log configuration; see syslog and syslogd for more information.
 

NOTES

The effects of the environment variable LC_MESSAGES apply only to diagnostic messages generated by logger, and not to any messages written by the use of the command.
 

EXIT STATUS

The following exit values are returned: Successful completion. An error occurred.
 

EXAMPLES

To log the system reboot, including the process ID of the process running logger, enter: logger -i System rebooted To log each line in the file build.events with the tag trial build preceding them, enter: logger -f build.events -t "trial build" The following commands are equivalent and enter events of warning priority to the log: logger -p warning

logger -p 4 The following commands are equivalent and enter events from the daemon facility of warning priority: logger -p daemon.warning

logger -p 24.4 To specify the debug priority with a priority name, enter: logger -p debug my message

To specify the debug priority with a priority number, enter: logger -p 7 my message To specify both debug priority and the user facility, enter: logger -p user.debug my message
To specify the same facility/priority pair using numeric values, enter: logger -p 8.7 my message
You can also combine alphabetic and numeric specifications: logger -p user.7 my message logger -p 8.debug my message

 

ENVIRONMENT VARIABLES

The following environment variables affect the execution of logger: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES.
 

SEE ALSO

Commands:  binlogd(8), syslogd(8), uerf(8)

Functions:  syslog(3)

Standards:  standards(5)


 

Index

NAME
SYNOPSIS
STANDARDS
OPTIONS
OPERANDS
DESCRIPTION
NOTES
EXIT STATUS
EXAMPLES
ENVIRONMENT VARIABLES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 02:43:04 GMT, October 02, 2010