Inject messages into the system log quickly for testing, monitoring and script annotations. 13.12.2025 | reading time: 2 min On a Linux host, `logger` lets him inject messages directly into the system log or journal; it is a fast tool to produce test events or to annotate automated tasks. A concrete example Run `logger -p user.info "Backup started for /srv"` to write a user-level info message, then run `tail -n 5 /var/log/syslog` or `journalctl -f` to observe a line such as "Jan 01 12:00:00 hostname logger[12345]: Backup started for /srv" appearing in the logs. Options that matter Use `-p` to set priority with the facility.level syntax, `-t` to add a custom tag, `-i` to include the PID, `-s` to also emit to stderr, and `-f` to log the contents of a file; some implementations also support `-n` and `-P` to forward messages to a remote syslog server, so check your local `logger --help` before relying on network features. Where to use it Embed `logger` in shell scripts, cron jobs and configuration-management hooks to create searchable audit entries, trigger monitoring alerts, or reproduce issues during troubleshooting, because it writes into the same pipelines consumed by rsyslog, syslog-ng or systemd-journald. Tools that complement logger For collection and processing use rsyslog or syslog-ng, for local binary journaling rely on systemd-journald, and for centralized analysis pair logs with a log-aggregator like the ELK stack or Grafana Loki. Final thought Small and dependable, `logger` gives him direct control over what appears in system logs; practice with it, then expand to centralized logging and alerting to get real value from the messages and to prepare for certifications like CompTIA Linux+ or LPIC-1 with focused training from bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting troubleshooting