InfrastructureServices / dnsconfd

Local DNS caching services configuration daemon.
Other
7 stars 2 forks source link

syslog should be used for logging #44

Open pemensik opened 4 months ago

pemensik commented 4 months ago

It provides ability to include severity of the message INTO the message. journalctl is then able to work with those severities and displays it in different colors. It would also allow to send selected priorities to different destination by configuration at rsyslog or similar. I think we want that, especially as we do not target non Unix systems in our project.

Compare these:

import syslog
syslog.syslog(syslog.LOG_ERR, 'error')
syslog.syslog(syslog.LOG_WARNING, 'warning')
syslog.syslog(syslog.LOG_INFO, 'info')
syslog.syslog(syslog.LOG_DEBUG, 'debug')
# now look at journalctl -xe

It makes it clear which one is more important. That is feature we want.

pemensik commented 4 months ago

There seems to be existing implementation: SyslogHandler

pemensik commented 4 months ago

But that requires special setup of socket, it seems syslog python module is what we want more. Needs a bit more analysis.