mailing list of musl libc
 help / color / mirror / code / Atom feed
* fmtmsg, syslog, and /dev/console
@ 2014-05-02 14:30 Isaac Dunham
  0 siblings, 0 replies; only message in thread
From: Isaac Dunham @ 2014-05-02 14:30 UTC (permalink / raw)
  To: musl

Hello,
As far as I can tell, the fmtmsg patch is waiting for comments due to the
use of /dev/console; syslog() does not write to /dev/console, and Rich
was asking about consistency. In other words, should both functions, 
neither, or only one write to /dev/console?

I would argue that making syslog() not write to the system console is 
reasonable since the console is a peripheral fallback in case of the 
failure of the logging facility, but that fmtmsg() is intended to 
generate a message for reading immediately, which requires the ability to
write to the system console.

If stderr is redirected to a log (or if it's closed, as in a forking daemon),
one would likely not have opportunity to read messages in a timely manner 
unless a log-watcher is installed.

On the other side of things, if syslog() ends up not being able to log
messages it usually means someone doesn't care about logs.

---
The standard describes the two functions thus (current posix-manpages, 
corresponding to POSIX2013):

The syslog() function shall send a message to an implementation-defined logging facility, which may log it in an implementation-defined system log, write it to the system console, forward it to a list of users, or forward it to the logging facility on another host over the network.

The fmtmsg() function shall display messages in a specified format 
instead of the traditonal printf() function.
Based on a message's classification component, fmtmsg() shall write a 
formatted message either to standard error, to the console, or to both.


Thanks,
Isaac Dunham


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-05-02 14:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-02 14:30 fmtmsg, syslog, and /dev/console Isaac Dunham

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).