LOGGER(1POSIX)
π LOGGER(1POSIX) β bestie edition π
okay so real talk: this is part of the POSIX Programmer's Manual. Heads up tho β the Linux implementation of this interface may differ, so pls consult the corresponding Linux manual page for the deets on Linux behavior. Or, plot twist, the interface might not even be implemented on Linux at all. π
β¨ NAME β¨
logger β log messages π
β¨ SYNOPSIS β¨
logger string...
β¨ DESCRIPTION β¨
So what does logger actually do? It saves a message β in an unspecified manner and format, bestie, we literally do not know the vibes β containing the string operands you the user provide. π
Those messages are expected to be evaluated later by personnel performing system administration tasks. iykyk. π
And here's a little caveat: it is implementation-defined whether messages written in locales other than the POSIX locale are effective. π
β¨ OPTIONS β¨
None. π Not a single one. She's minimal like that.
β¨ OPERANDS β¨
The following operand shall be supported:
stringβ one of the string arguments whose contents are concatenated together, in the order specified, separated by single<space>characters. So like, they all get smooshed into one message with lil spaces between them. π«Ά
β¨ STDIN β¨
Not used. She doesn't read from stdin, she's not about that life.
β¨ INPUT FILES β¨
None. Nada. Zero. π«
β¨ ENVIRONMENT VARIABLES β¨
The following environment variables shall affect the execution of logger:
LANGβ provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1β2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)LC_ALLβ if set to a non-empty string value, override the values of all the other internationalization variables. She said ALL and she meant it. πLC_CTYPEβ determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).LC_MESSAGESβ determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. β οΈ Quick clarification so nobody gets confused: this means diagnostics fromloggerto the user or application β not diagnostic messages that the user is sending to the system administrator. Two totally different things, bestie.NLSPATHβ determine the location of message catalogs for the processing ofLC_MESSAGES. ποΈ
β¨ ASYNCHRONOUS EVENTS β¨
Default.
β¨ STDOUT β¨
Not used. Nothing goes to standard output. β¨
β¨ STDERR β¨
The standard error shall be used only for diagnostic messages. That's it, that's her whole job there.
β¨ OUTPUT FILES β¨
Unspecified. Mystery. Enigma. π¦
β¨ EXTENDED DESCRIPTION β¨
None.
β¨ EXIT STATUS β¨
The following exit values shall be returned:
0β successful completion. slay. β>0β an error occurred. π
β¨ CONSEQUENCES OF ERRORS β¨
Default.
The following sections are informative. (aka, the lore, not the law π)
β¨ APPLICATION USAGE β¨
This utility lets you log information for later use by a system administrator or programmer, so they can figure out why non-interactive utilities have failed. π
The locations of the saved messages, their format, and their retention period are all unspecified. And here's the wild part: there is no method for a conforming application to read messages, once written. You write them, and then... they're gone into the void. π
β¨ EXAMPLES β¨
Picture this: a batch application, running non-interactively, tries to read a configuration file and fails. Tragic. It may attempt to notify the system administrator with:
logger myname: unable to read file foo. [timestamp]
β¨ RATIONALE β¨
So the standard developers believed strongly that some method of alerting administrators to errors was necessary. The obvious example? A batch utility, running non-interactively, that can't read its configuration files, or can't create or write its results file. π
But here's the thing β they did not wish to define the format or delivery mechanisms, because those have historically been (and will probably continue to be) very system-specific, plus that functionality is clearly outside the scope of this volume of POSIX.1β2017.
That LC_MESSAGES text about diagnostic messages? Yeah, it means diagnostics from logger to the user or application β not diagnostic messages that the user is sending to the system administrator. (Yes this is stated twice. It's that important, ok. π)
Multiple string arguments are allowed, similar to echo, for ease-of-use. π«Ά
And like the utilities mailx and lp, logger is admittedly difficult to test. But that was not deemed sufficient justification to exclude these utilities from this volume of POSIX.1β2017. It's also arguable that they are, in fact, testable β but that the tests themselves are not portable. π€·βοΈ
β¨ FUTURE DIRECTIONS β¨
None.
β¨ SEE ALSO β¨
lp, mailx, write
The Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables
β¨ COPYRIGHT β¨
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
okay that's the whole page bestie, we ate and left no crumbs π
β¨ this edition was brought to you by IEEE/The Open Group, 2017 β LOGGER(1POSIX), periodt. ππ
π¦ where this page comes from
- debian bookworm: manpages-posix 2017a-2 Β· Other
- debian trixie: manpages-posix 2017a-2 Β· Other
- ubuntu jammy: manpages-posix 2017a-2 Β· Other
- ubuntu noble: manpages-posix 2017a-2 Β· Other
- ubuntu resolute: manpages-posix 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms