messages to system log, or a log file
can be used to log messages to the system
log daemon from a UNIX shell, or script. Optionally a stand-alone log file can
be used, in which case the
still used but syslogd
is bypassed. This log file
can also be automatically log rotated.
Without a MESSAGE
reads input from
This program follows the usual UNIX command line syntax:
- Log to console
syslog() fails to send message to
- Log this in the structured data (SD) field of an RFC5424
style log message. See -m for caveats. Also,
please note that sd has to be passed as
one argument and will require careful quoting when used from the
- Log file to write messages to, instead of syslog daemon.
-f- as an alias for
- Log the process id of the logger process with each line
- The MSGID used for the message. Requires RFC5424 support in
receiving the message and also for storing it properly in a log file or
sending remote in correctly formatted RFC5424 style.
- Open log file immediately
- Priority, numeric or
- Controls log file rotation.
SIZE denotes number of bytes before
rotating, default: 200 kB. NUM denotes
number of rotated files to keep when logging to a file, default: 5.
- Log to stderr as well as the system log.
- Log using the specified tag, default: username.
- Log to UNIX domain socket
SOCK instead of the default
- Show program version.
- Log message to write. Remember to use single/double qoutes
if calling logger from a shell prompt due to
expansion the shell does. If no message is given
logger will read from
stdin until EOF. In this mode every new
row (newline separated) is converted into an independent
logger -t dropbear -p auth.notice "Successful login for user 'admin' from 188.8.131.52"
logger -t udhcpc -f /tmp/script.log "New lease 184.108.40.206 obtained for interface eth0"
- If a custom log file is selected, using
then this file is opened and written to by
logger. When log file rotation is enabled,
FILE.1 FILE.2 FILE.3.gz etc.
- Socket used for communicating with
When built on BSD /var/run/log is used.
was originally written by Joachim Nilsson to
be a part of the
monitor (PID 1), where it is called logit
. It is
included here to complement
extended upon in the sysklogd project.
command is expected to be IEEE Std
1003.2 ("POSIX.2") compatible, with extensions for RFC5424 from
NetBSD and custom log file and log file rotation unique to the sysklogd