logger(1)

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 -f flag 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.

  1. 2.1–2.3
  2. 2.4
  3. 2.5
  4. 2.6
  5. 2.7–2.8
  6. 2.9–3.0
  7. 3.1–3.3
  8. 3.4
  9. 3.5–4.1
  10. 4.2–4.4
  11. 4.5–4.8
  12. 4.9–5.1
  13. 5.2–5.3
  14. 5.4–6.5
  15. 6.6–8.0

-c since OpenBSD 6.6.

Standards

The logger utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.

The flags [-cfipst] are extensions to that specification.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.