LOGGER(1P)
π LOGGER(1P) π
okay bestie, so this one is a page from the POSIX Programmer's Manual, and it's all about logger. sit down, hydrate, we're doing this. π«Ά
PROLOG β¨
so like, important heads-up first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ β so go check 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. π it's giving "read the fine print, babe."
NAME π
logger β log messages. that's it, that's the whole job, and she does it flawlessly. π
SYNOPSIS β
logger string...
DESCRIPTION π¦
so logger saves a message, in an unspecified manner and format (yes bestie, unspecified β she keeps her secrets), and that message contains the string operands you hand her. β¨
these messages are expected to be evaluated later by personnel performing system administration tasks. so like... it's a note in a bottle for your sysadmin. a little "hey girl, something happened" tucked away for future-you or future-them. π
also, real talk: it is implementation-defined whether messages written in locales other than the POSIX locale are effective. so don't @ me if your non-POSIX-locale messages just vibe into the void. π
OPTIONS πΈ
None.
not a single one. zero. she's minimalist, she's booked, she's busy, she needs no flags. π
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 if you pass three strings, they get glued into one with spaces between. like a group chat message that got split across four texts. fr fr.
STDIN π
not used. she's not reading your input, bestie, she's the one talking. π
INPUT FILES π
none. zero. nada. nothing to see here. β¨
ENVIRONMENT VARIABLES π§
these are the env vars that shall affect how logger runs:
LANGβ provides 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.) it's the fallback bestie, the "if nobody else showed up, I got you" of locale variables. π«ΆLC_ALLβ if set to a non-empty string value, it overrides the values of all the other internationalization variables. she's the main character and she will not be taking questions. πLC_CTYPEβ determines 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). so like, how do we read these bytes? as one little guy or as a whole squad? π¦LC_MESSAGESβ determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error. (this means diagnostics fromloggerto the user or application, NOT diagnostic messages that the user is sending to the system administrator.) ok this distinction matters so much, don't mix them up. two totally different conversations. πNLSPATHβ determines the location of message catalogs for the processing ofLC_MESSAGES. it's the map to where the message catalogs live. πΊοΈ
ASYNCHRONOUS EVENTS β
default. she's keeping it classic, no drama. π
STDOUT π
not used. she's not out here printing things to your terminal, she's writing her little note somewhere else entirely. secretive queen. π€«
STDERR π
the standard error shall be used only for diagnostic messages. that's it. that's its whole job. don't make it do more. π
OUTPUT FILES πΈ
unspecified. where do the messages go?? nobody knows!! (well, somebody knows, it's just not written down here. it's giving mystery. it's giving β¨enigmaticβ¨.) π
EXTENDED DESCRIPTION π
none. no extra lore, bestie. this is the whole page. π«Ά
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. (so like, cute bonus content, not the law. iykyk.)
APPLICATION USAGE β¨
ok so here's the vibe: this utility lets you log info for later use by a system administrator or a programmer, so they can figure out why non-interactive utilities have failed. detective work, but make it logs. π
the locations of the saved messages, their format, and their retention period are all unspecified. and β this is the real tea β there is no method for a conforming application to read messages, once written. like. she writes the note and walks away. no receipts, no read-back, no follow-ups. it's giving "post and ghost." π
EXAMPLES π
so picture this: a batch application, running non-interactively, tries to read a configuration file and fails. it may attempt to notify the system administrator with:
logger myname: unable to read file foo. [timestamp]
like a little "hey bestie, something's wrong, here's my name, here's the file, here's when it happened." π£
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 is unable to read its configuration files, or that is unable to create or write its results file. she's screaming into the void and the void needs to hear it. π€
BUT β the standard developers did not wish to define the format or delivery mechanisms, because those have historically been (and will probably continue to be) very system-specific, and also because they involve functionality clearly outside the scope of this volume of POSIX.1β2017. so like, they were like "we support this, we just aren't gonna micromanage how it's done." respect. π
the text with LC_MESSAGES about diagnostic messages means diagnostics from logger to the user or application β NOT diagnostic messages that the user is sending to the system administrator. this is like. the whole point. don't get it twisted. π
multiple string arguments are allowed, similar to echo, for ease-of-use. more strings = more convenient. iconic behavior. β¨
and ngl, 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. so basically: hard to test, still valid, we're keeping her. π«Ά
FUTURE DIRECTIONS π
none. she's not going anywhere, she's not changing, she's perfect as she is. periodt. π
SEE ALSO π
lpmailxwrite
the Base Definitions volume of POSIX.1β2017, Chapter 8, Environment Variables. go read those too bestie, they're the supporting cast. π
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 .
ok that's the whole thing!! π that was LOGGER(1P) from IEEE/The Open Group, dated 2017 β so when you cite her, cite her right. mwah, love you, go log something. π
β¨ππ¦
π¦ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 Β· custom
- alpine 3.23: man-pages-posix 2017a-r0 Β· custom
- alpine 3.24: man-pages-posix 2017a-r0 Β· custom
- arch rolling: man-pages 6.19-1
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 Β· SUSE-IEEE
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms