unbound icon indicating copy to clipboard operation
unbound copied to clipboard

logfile config option ignored

Open elderlabs opened this issue 3 years ago • 1 comments

According to the documentation, Unbound should log to a logfile when specified in the config, which should then also disable logging to syslog. This is the expected behavior, however, does not seem to be the case. I've verified Unbound's user has access to the logfile, specified in the config, and verified I'm running the latest version available via Debian 11's apt repo, 1.13.1-1, but can see no fault on my end. The config options I'm using are listed below.

server:
    # If no logfile is specified, syslog is used
    logfile: "/var/log/unbound/unbound.log"
    log-queries: no
    use-syslog: no
    verbosity: 3

Thanks.

elderlabs avatar Dec 23 '21 20:12 elderlabs

This configuration settings logs to file just fine when I use it. To use it I add a number of other options (port, interface, pidfile, chroot, username, directory) to it, and it logged to the specified file just fine.

Perhaps there is an include statement that includes multiple config files, like some distros ship with, and you have other configuration files that are included after it? The last settings take effect.

If you start unbound with -d, it stays connected to the terminal, and with verbosity high it prints that it switches to the logfile, in a log message still to the terminal before it switches away from the terminal. Then interrupt or kill the unbound process. And you can see what unbound is doing when it starts to write to the logfile. Or are there perhaps other configuration statements? On some systems there are several places for configuration files, and you can edit the wrong one, eg. /etc, vs /usr/local/etc, vs /var/lib/unbound or so.

wcawijngaards avatar Jan 06 '22 12:01 wcawijngaards