syslog.h(7POSIX)

πŸ¦‹ syslog.h β€” the girlies' guide to system error logging πŸ¦‹

okay bestie, quick vibe check before we dive in: this is the syslog.h page from the POSIX Programmer's Manual (that's the manual name, she's fancy). πŸ’…


✨ PROLOG ✨

Real talk first, no cap: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go read the corresponding Linux manual page for the actual Linux tea, bestie), or the interface might just... not be implemented on Linux at all. πŸ’€


πŸ’– NAME πŸ’–

syslog.h β€” definitions for system error logging. that's it, that's the girl. πŸŽ€


🌸 SYNOPSIS 🌸

#include <syslog.h>

πŸ”₯ DESCRIPTION πŸ”₯

so <syslog.h> is gonna define a whole lil squad of symbolic constants. zero or more of them can be OR'ed together to build the logopt option that openlog() takes. iconic behavior honestly:

  • LOG_PID β€” logs the process ID with each message. she's saying "this was ME" 🫢
  • LOG_CONS β€” logs to the system console on error.
  • LOG_NDELAY β€” connects to the syslog daemon immediately. no waiting, main character energy.
  • LOG_ODELAY β€” delays the open until syslog() gets called. lowkey patient of her.
  • LOG_NOWAIT β€” do not wait for child processes. she's not gonna sit around for anybody. πŸ’…

and THEN, <syslog.h> shall define these next symbolic constants, for use as the facility argument to openlog(). it's giving ✨categories✨:

  • LOG_KERN β€” reserved for message generated by the system.
  • LOG_USER β€” message generated by a process.
  • LOG_MAIL β€” reserved for message generated by mail system.
  • LOG_NEWS β€” reserved for message generated by news system.
  • LOG_UUCP β€” reserved for message generated by UUCP system.
  • LOG_DAEMON β€” reserved for message generated by system daemon.
  • LOG_AUTH β€” reserved for message generated by authorization daemon.
  • LOG_CRON β€” reserved for message generated by clock daemon.
  • LOG_LPR β€” reserved for message generated by printer system.
  • LOG_LOCAL0 β€” reserved for local use.
  • LOG_LOCAL1 β€” reserved for local use.
  • LOG_LOCAL2 β€” reserved for local use.
  • LOG_LOCAL3 β€” reserved for local use.
  • LOG_LOCAL4 β€” reserved for local use.
  • LOG_LOCAL5 β€” reserved for local use.
  • LOG_LOCAL6 β€” reserved for local use.
  • LOG_LOCAL7 β€” reserved for local use.

(yes bestie, that's all eight of the LOG_LOCAL girlies, we love a numbered set 🌈)


okay next: <syslog.h> shall define the following macros for constructing the maskpri argument to setlogmask(). here's the lil technical note β€” these macros expand to an expression of type int when the argument pri is an expression of type int. periodt:

  • LOG_MASK(pri) β€” a mask for priority pri.

and NOW, the priority constants πŸ’… β€” these get used as the priority argument of syslog():

  • LOG_EMERG β€” a panic condition was reported to all processes. 😭 emergency emergency
  • LOG_ALERT β€” a condition that should be corrected immediately.
  • LOG_CRIT β€” a critical condition.
  • LOG_ERR β€” an error message.
  • LOG_WARNING β€” a warning message.
  • LOG_NOTICE β€” a condition requiring special handling.
  • LOG_INFO β€” a general information message.
  • LOG_DEBUG β€” a message useful for debugging programs. πŸ›

the following shall be declared as functions, and may also be defined as macros. function prototypes shall be provided, so here they are, verbatim, no edits:

void  closelog(void);
void  openlog(const char *, int, int);
int   setlogmask(int);
void  syslog(int, const char *, ...);

and then β€” the following sections are informative. πŸ‘€


πŸ’œ APPLICATION USAGE πŸ’œ

None. she said nothing. silence. 🀐


🧚 RATIONALE 🧚

None. again, no thoughts, head empty. πŸŽ€


🌈 FUTURE DIRECTIONS 🌈

None. the future is... unspecified bestie.


⭐ SEE ALSO ⭐

The System Interfaces volume of POSIX.1‐2017, closelog() β€” go read that one next, iykyk 🫢


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 .

and that's the whole page bestie, we ate and left no crumbs πŸ’…βœ¨ β€” this one was brought to you by IEEE/The Open Group, 2017, on the syslog.h(7POSIX) page. slay, bye! πŸ¦‹πŸ’–