logger(1)

πŸ“¦
version 2.8 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– logger β€” bestie's guide to yelling into the system log πŸ’–

okay so you're holding the logger(1) page from the User's Reference Manual and honestly? it's giving main character energy for such a tiny command. let's get into it 🫢


✨ NAME ✨

logger β€” make entries in the system log

like. that's it. that's the whole job. she writes stuff into the log. iconic behavior honestly πŸ‘‘


🌸 SYNOPSIS 🌸

logger [options ...] [message ...]

yeah that's the whole vibe. options, then a message, or don't. she's flexible πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so logger is basically a lil shell-command front door to the syslog(3) system log module. that's the tea. you run it, it talks to syslog, syslog writes the line. no cap. ✨


πŸ’… OPTIONS πŸ’…

okay this is the part everyone skips and then wonders why nothing works. NOT you tho. you're gonna read all of them. periodt.

  • -4, --ipv4 β€” use IPv4 to connect to hosts. old reliable fr fr.
  • -6, --ipv6 β€” use IPv6 to connect to hosts. the future is now bestie 🌈
  • -S, --source _ip_ β€” set the source IP address. you're picking which face she shows up with 😌
  • -h, --host _host_ β€” log to _host_ instead of to the default /dev/log. going remote, we love a road trip πŸš—
  • -u, --unix _sock_ β€” log to UNIX socket _sock_ instead of /dev/log. different socket, same energy 🧦
  • -i, --id [_pid_] β€” log the process id of the logger process with each line. so people know who said it. very "no anonymous messages" of her πŸ’€
  • -s, --stderr β€” log the message to standard error, as well as the system log. double posting. she contains multitudes.
  • -f, --file _file_ β€” log the specified _file_. whole file, one go πŸ“„
  • -p, --priority _pri_ β€” enter the message with the specified priority. the priority can be numeric or 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." β€” remember that default, it's the one people always forget πŸ™ˆ
  • -t, --tag _tag_ β€” mark every line in the log with the specified _tag_. your lil signature. brand it πŸŽ€
  • --usage β€” display a short usage message. the tl;dr version.
  • -?, --help β€” display a help list. the slightly longer tl;dr version.
  • -V, --version β€” display program version. for when you need to know which era of her you're talking to.
  • _message_ β€” write the message to log; if not specified, and the -f flag is not provided, standard input is logged. so like, if you give her nothing, she'll take it from stdin. she's not picky πŸ’–
🫢 important lil note bestie: the logger utility exits 0 on success, and >0 if an error occurs. check that exit status. always. it's free information.

πŸ”₯ EXAMPLES πŸ”₯

look at her go:

logger System rebooted
logger -p local0.notice -t HOSTIDM -f /dev/idmc

first one: just says the thing. second one: priority local0.notice, tag HOSTIDM, reading from the file /dev/idmc. chef's kiss 🀌✨


⭐ SEE ALSO ⭐

go read those too. iykyk 🧚


πŸ‘‘ STANDARDS πŸ‘‘

the logger command is expected to be IEEE Std 1003.2 (β€œPOSIX.2”) compatible. so like, standards-compliant. she's not just cute, she's certified cute πŸ’œ


and that's the page!! this came from GNU Network Utilities, dated February 15, 2019. go log something slay-worthy, bestie πŸŒΈπŸ’–βœ¨

πŸ“¦ where this page comes from