logger1
Make entries in the system log
Usage
logger [-cis]
[-f
file]
[-p
pri]
[-t
tag]
[message ...]
Overview
The logger utility provides a shell command interface to the syslog(3) system log module.
The options are as follows:
-
-c -
If unable to pass the message to syslogd(8), attempt to write the message to the console.
-
-f file -
Read from the specified file.
-
-i -
Log the process ID of the logger process with each line.
-
-p pri -
Enter the message with the specified priority. The priority may be specified numerically or as a “facility.level” pair. For example, “-p local3.info” logs the message(s) as informational level in the local3 facility. The default is “user.notice”.
-
-s -
Log the message to standard error, as well as the system log.
-
-t tag -
Mark every line in the log with the specified tag.
- message
-
Write the message to log; if not specified, and the
-fflag is not provided, standard input is logged.
Exit status
The logger utility exits 0 on success, and >0 if an error occurs.
Examples
$ logger System rebooted $ logger -p local0.notice -t HOSTIDM -f /dev/idmc
Releases
61 releases since OpenBSD 2.1; the text changed 14 times.
- 2.1–2.3
- 2.4
- 2.5
- 2.6
- 2.7–2.8
- 2.9–3.0
- 3.1–3.3
- 3.4
- 3.5–4.1
- 4.2–4.4
- 4.5–4.8
- 4.9–5.1
- 5.2–5.3
- 5.4–6.5
- 6.6–8.0
-c since OpenBSD 6.6.