Logging

log_alert

Log an alert-level message via logmsg. Suppressed when LOG_LEVEL is EMERG.

Arguments

  • ... (string): Message text

Exit codes

  • 0: Always

log_crit

Log a critical-level message via logmsg. Suppressed when LOG_LEVEL is ALERT or EMERG.

Arguments

  • ... (string): Message text

Exit codes

  • 0: Always

log_error

Log an error message via logmsg. Suppressed when LOG_LEVEL is CRIT, ALERT, or EMERG.

Arguments

  • ... (string): Message text

Exit codes

  • 0: Always

log_err

Alias for log_error (RFC 5424 priority name).

log_warn

Log a warning message via logmsg. Suppressed when LOG_LEVEL is ERR/ERROR, CRIT, ALERT, or EMERG.

Arguments

  • ... (string): Message text

Exit codes

  • 0: Always

log_warning

Alias for log_warn (RFC 5424 priority name).

log_notice

Log a notice message via logmsg. Suppressed when LOG_LEVEL is WARNING/WARN, ERR/ERROR, CRIT, ALERT, or EMERG.

Arguments

  • ... (string): Message text

Exit codes

  • 0: Always

log_info

Log an informational message via logmsg. Suppressed when LOG_LEVEL is NOTICE or more severe.

Arguments

  • ... (string): Message text

Exit codes

  • 0: Always

log_debug

Log a debug message via logmsg. Suppressed unless LOG_LEVEL=DEBUG.

Arguments

  • ... (string): Message text

Exit codes

  • 0: Always

logmsg

Log a message to the system log using systemd-cat, logger, or a fallback file. Accepts an optional -p priority, -t tag, and -s flag to also print to stdout.

When -p is given, the priority is forwarded to the underlying transport: systemd-cat receives --priority=; logger receives -p user..

Options

  • -p

string Syslog priority name (emerg alert crit err warning notice info debug)

  • -s

Also print to stdout

  • -t

string Syslog identifier / tag

Arguments

  • ... (string): Message text

Exit codes

  • 0: Message logged successfully
  • 1: Invalid option

Output on stdout

  • Message line when -s is given