[Python-ideas] SysLogHandler: gratuitous data loss

Jacek Masiulaniec jacek.masiulaniec at gmail.com
Fri Jun 8 15:21:59 CEST 2012


In logging.handlers, SysLogHandler defaults to localhost:514.


In practice, there are systems out there that offer local syslog
service via additional endpoints, for example:


Some systems even ship with UDP endpoint disabled by default, in
which case Python's default is to drop data despite the availability
of these other endpoints.

The /dev/log path in particular is so commonplace that many
system-level utils default to it.  Other languages' syslog libraries
provide support for it, too. [1] [2]

I propose a change to SysLogHandler's default behavior:
1) Try connect(2) against the socket files.
2) Use localhost:514 as a fallback.

I believe it's possible to change this interface while remaining



[1] http://hackage.haskell.org/packages/archive/hslogger/1.0.7/doc/html/src/System-Log-Handler-Syslog.html#openlog
[2] http://golang.org/src/pkg/log/syslog/syslog_unix.go

More information about the Python-ideas mailing list