Logger - Syslog Interaction Tool | Online Free DevTools by Hexmos

Interact with syslog server using the Logger command. Send messages with custom facilities and priorities. Free online tool for developers.

Logger

Syslog Interaction Tool

The logger command is a powerful utility for interacting with the syslog server on Unix-like systems. It allows you to send messages to the system log with specified priorities and facilities, making it invaluable for debugging, monitoring, and system administration tasks. This tool helps developers quickly send log entries from scripts or the command line.

Basic Usage and Examples

Here are some common ways to use the logger command:

# logger
# Interact with syslog server

# log "hi there" to syslog with priority 'notice' and facility 'user'
echo "hi there" | logger

# send <file> to syslog with <facility> and <level>
logger -p <facility>.<level> -f <file>

Understanding Syslog Priorities and Facilities

Syslog messages are categorized by both a facility and a priority level. Understanding these helps in filtering and analyzing logs effectively.

Syslog Levels (Priorities)

These indicate the severity of the message:

  • emerg: Emergency: system is unusable
  • alert: Alert: action must be taken immediately
  • crit: Critical: critical conditions
  • err: Error: error conditions
  • warning: Warning: warning conditions
  • notice: Notice: normal but significant condition
  • info: Informational: informational messages
  • debug: Debug: debug-level messages

Syslog Facilities

These indicate the source of the message:

  • auth
  • authpriv (for security information of a sensitive nature)
  • cron
  • daemon
  • ftp
  • lpr
  • mail
  • news
  • syslog
  • user
  • uucp
  • local0 to local7 (local7 is often used for boot messages)

Further Resources