logger(1)
NAME
logger − make entries in the system log
SYNOPSIS
logger [-t tag] [-p pri] [-i] [-f file] [message...]
DESCRIPTION
logger 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 file is read and each line is logged. If no file or message is specified, the contents of the standard input are logged.
Options
logger recognizes the following command-line options and arguments:
-t tag Mark every line in the log with the specified tag. The default is the value returned by getlogin() (see getlogin(3C)). If getlogin() returns NULL, syslog is the default.
-p pri Enter the message with the specified priority. The priority can be specified numerically or as a facility.level pair. For example, -p local3.info logs the message or messages as informational level in the local3 facility. The default is user.notice.
-i Log the process ID of the logger process with each line.
-f file Log the contents of the specified file.
message The message to log; if not specified, the file specified by the -f option or standard input is logged.
EXTERNAL INFLUENCES
Environment Variables
LANG determines the language in which diagnostic messages from logger to the user are displayed.
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 -p local0.info -t USERS
WARNINGS
logger has no effect if the syslogd daemon (see syslogd(1M)) is not running on the system.
AUTHOR
logger was developed by the University of California, Berkeley.
SEE ALSO
syslogd(1M), getlogin(3C), syslog(3C).
STANDARDS CONFORMANCE
logger: POSIX.2
Hewlett-Packard Company — HP-UX Release 9.03: April 1994