Allow configuration of syslog facility
Currently, Knot DNS, when configured to use syslog, called openlog() like this:
openlog(PACKAGE_NAME, LOG_PID, LOG_DAEMON)
The PACKAGE_NAME becomes "knot". With the configuration, Knot's log messages usually end up in /var/log/messages on most Linux systems, because most of them are configured to log "*.info" to /var/log/messages. This has 2 problems:
- It's not easy to send Knot's logging to another destination (such as a remote syslog server)
- If Knot is compiled and configured for debug logging, the debug messages will still be suppressed by the syslog server, because of the above "*.info" rule.
In order to fix the above issue, one has to completely reconfigure the syslog server. It would be nice if Knot could allow the facility to be configured as well, and then an operator can choose to emit logs from Knot with a facility like "local3". This then allows for a simple rule in the syslog config of the type:
local3.* <destination of choice>