I'm working on Ubuntu 16.04.3 and I found that I could get the log of kernel from two places: /var/log/kern.log and /var/log/syslog. /var/log/syslog contains other logs but I could find /var/log/kern.log in it.

So it is possible to keep the kern.log out of the syslog? I mean I want to remove the kern.log from the syslog?

I've tried to remove the module(load="imklog") from the /etc/rsyslog.conf but this will remove all of kernel log from the kern.log and the syslog, whereas what I need is not to touch the kern.log, only to remove the kernel log from the syslog.

1 Answer 1


On Ubuntu 16.04, your rsyslog rules would be found in the /etc/rsyslog.d/50-default.conf file. Inside that file, you'll see the two following lines:

*.*;auth,authpriv.none      -/var/log/syslog
kern.*                      -/var/log/kern.log

You could skip the kernel messages from being logged to /var/log/syslog like so:

*.*;auth,authpriv,kern.none     -/var/log/syslog
kern.*                          -/var/log/kern.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.