syslog.h(0P)
π¦ syslog.h(0P) β POSIX Programmer's Manual, bestie edition π
okay so real talk, this page is from the POSIX Programmer's Manual (syslog.h(0P), the 0P is giving very POSIX-coded). but heads up before we go any further: the Linux implementation of this interface may differ β so pls consult the corresponding Linux manual page for the deets on Linux behavior. also it's possible this interface justβ¦ isn't implemented on Linux at all. π vibe check accordingly.
β¨ PROLOG β¨
so like, this manual page is part of the POSIX Programmer's Manual, fr fr. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. that's the whole disclaimer, love that for us.
π NAME π
syslog.h β definitions for system error logging. yes bestie, it's THE header for when your programs need to scream into the void (the void being the system log). iconic behavior honestly.
πΈ SYNOPSIS πΈ
#include <syslog.h>
that's it. one include. slay.
π DESCRIPTION π
The <syslog.h> header shall define the following symbolic constants, zero or more of which may be OR'ed together to form the logopt option of openlog(). (zero or more! so you can stack them like friendship bracelets π«Ά)
LOG_PIDβ Log the process ID with each message. so you know which little guy did the thing.LOG_CONSβ Log to the system console on error. going straight to the big screen, main character energy.LOG_NDELAYβ Connect to syslog daemon immediately. no waiting, we're impatient and that's valid.LOG_ODELAYβ Delay open untilsyslog()is called. the slow burn approach.LOG_NOWAITβ Do not wait for child processes. we do not babysit here.
π facility constants (for the facility argument to openlog()) π
The <syslog.h> header shall define the following symbolic constants for use as the facility argument to openlog():
LOG_KERNβ Reserved for message generated by the system.LOG_USERβ Message generated by a process. (that's you! hi!)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.
(seven whole LOG_LOCAL slots just vibing there for you to use however you want, no cap π)
π§ priority mask macros (for the maskpri argument to setlogmask()) π§
The <syslog.h> header shall define the following macros for constructing the maskpri argument to setlogmask(). The following macros expand to an expression of type int when the argument pri is an expression of type int:
LOG_MASK(pri)β A mask for priority pri.
β priority constants (for the priority argument of syslog()) β
The <syslog.h> header shall define the following symbolic constants for use as the priority argument of syslog():
LOG_EMERGβ A panic condition was reported to all processes. π¨ everything is on fire, tell everyone.LOG_ALERTβ A condition that should be corrected immediately. like RIGHT now bestie.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 little guys that only matter when things break.
π«Ά the functions π«Ά
The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.
void closelog(void);
void openlog(const char *, int, int);
int setlogmask(int);
void syslog(int, const char *, ...);
β οΈ note the "may also be defined as macros" thing β so don't go doing anything cursed like taking their address, okay? just call them normally like a well-behaved legend. π
π informative sections π
The following sections are informative.
π APPLICATION USAGE π
None.
(genuinely nothing. the void. we stan a low-effort section.)
π RATIONALE π
None.
(again β nothing! they really said "no thoughts, head empty" π)
π FUTURE DIRECTIONS π
None.
(no dramatic future plans, it's giving stable.)
π₯ SEE ALSO π₯
The System Interfaces volume of POSIX.1β2017, closelog()
π 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 .
and that's the whole page bestie, mwah π
this lil masterpiece comes to you courtesy of IEEE/The Open Group, dated 2017, filed under syslog.h(0P). go forth and log responsibly, queen. πβ¨
π¦ 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