
logger(1)logger(1)
NAME
logger - make entries in the system log
SYNOPSIS
logger
DESCRIPTION
The logger command provides a program interface to the syslog() system log module (see syslog(3C)).
A message can be given on the command line, which is logged immediately, or a ®le is read and each line is logged. If no ®le or message is speci®ed, the contents of the standard input are logged.
Options
The logger command recognizes the following
Mark every line in the log with the speci®ed tag. The default is the value returned by | |
| getlogin() (see getlogin(3C)). If getlogin() returns NULL, syslog is the |
| default. |
Enter the message with the speci®ed priority. The priority can be speci®ed numeri- | |
| cally or as a facility.level pair. For example, |
| or messages as informational level in the local3 facility. The default is |
| user.notice . |
Log the process ID of the logger process with each line. | |
Log the contents of the speci®ed ®le. | |
message | The message to log; if not speci®ed, the ®le speci®ed by the |
| input is logged. |
EXTERNAL INFLUENCES
Environment Variables
LC_MESSAGES determines the language in which messages are displayed.
If LC_MESSAGES is not speci®ed in the environment or is set to the empty string, the value of LANG is used as a default for each unspeci®ed or empty variable. If LANG is not speci®ed or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.
If any internationalization variable contains an invalid setting, logger behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and
EXAMPLES
Send the message System rebooted to the syslogd daemon:
logger System rebooted
Send output from the users command (see users(1) to the syslogd daemon, marked as level info and facility local0. The message is tagged with the string USERS:
users logger
Send the message System going down immediately!!! to the syslog daemon, at the emerg level and user facility:
logger
WARNINGS
The logger command has no effect if the syslogd daemon (see syslogd(1M)) is not running on the sys- tem.
Messages written in locales other than the POSIX/C locale are not supported.
l
− 1 − | Section 1−459 |