[ Bottom of Page | Previous Page | Next Page | Contents | Index |  Library Home |
Legal |
Search ]
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. The
messages returned by the LOG_KERN facility cannot be
logged by this command.
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
- To log a message indicating a system reboot, enter: 
logger System rebooted 
- To log a message contained in the /tmp/msg1 file, enter: 
logger -f /tmp/msg1 
- 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.
   
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]