D
Deleted member 65380
Guest
edit: this started as a unbound+syslog post but it has evolved into a howto. Because of the evolution it's a little out of sequence but it's complete.
Quick prerequisites: pkg install unbound, disable local_unbound. cd /usr/local/etc/unbound/ edit config. Tip, don't disable local_unbound before installing unbound (or pkg can't resolve things...)
I've seen many posts saying if unbound is in a chroot then set logfile: "/usr/local/etc/unbound/unbound.log", you can do that but you don't have to.
I am here to confirm that syslog works fine, with a tweak.
By default unbound+syslog will only catch the DEBUG messages so you only get a portion of the content as if you'd specified a log file, it is quite annoying. This is because unbound calls syslog with DEBUG, INFO and so on if you've configured "yes" to some of unbounds log-xxxxxx: options.
edit /usr/local/etc/unbound/unbound.conf and comment out the logfile
Configure syslog (how I did it):
I chose to put this config file here because /etc/syslogd.conf includes that directory and keeps the customization slightly out of the base OS (but the logs in one place).
chrbr had me in the right direction: https://forums.freebsd.org/threads/unbound-log-file.73205/
I still need to stop it logging to /var/log/debug.log though... was happy with the above so wanted to share it.
edit: to remove logging to debug.log unfortunately I had to modify /etc/syslog.conf, was unaltered prior, adding the unbound line like so:
Quick prerequisites: pkg install unbound, disable local_unbound. cd /usr/local/etc/unbound/ edit config. Tip, don't disable local_unbound before installing unbound (or pkg can't resolve things...)
I've seen many posts saying if unbound is in a chroot then set logfile: "/usr/local/etc/unbound/unbound.log", you can do that but you don't have to.
I am here to confirm that syslog works fine, with a tweak.
By default unbound+syslog will only catch the DEBUG messages so you only get a portion of the content as if you'd specified a log file, it is quite annoying. This is because unbound calls syslog with DEBUG, INFO and so on if you've configured "yes" to some of unbounds log-xxxxxx: options.
man syslog.conf:
The level describes the severity of the message, and is a keyword from
the following ordered list (higher to lower): emerg, crit, alert, err,
warning, notice, info and debug. These keywords correspond to similar
"LOG_" values specified to the syslog(3) library routine.
edit /usr/local/etc/unbound/unbound.conf and comment out the logfile
Code:
# logfile: "/usr/local/etc/unbound/unbound.log"
Code:
# mkdir /usr/local/etc/syslog.d
# vi /usr/local/etc/syslog.d/unbound.conf
# cat /usr/local/etc/syslog.d/unbound.conf
!unbound
*.* /var/log/unbound.log
chrbr had me in the right direction: https://forums.freebsd.org/threads/unbound-log-file.73205/
I still need to stop it logging to /var/log/debug.log though... was happy with the above so wanted to share it.
edit: to remove logging to debug.log unfortunately I had to modify /etc/syslog.conf, was unaltered prior, adding the unbound line like so:
Code:
!-devd
!-unbound
*.=debug /var/log/debug.log
Last edited by a moderator: