/var/log/messages
is not used in Ubuntu (it got removed around Natty). We use /var/log/syslog
for that. Everything logged to 'messages' back then was also logged into 'syslog' so we got rid of one of them.
I do have a syslog and a kern.log in /var/log/
. I would expect the last one to hold anything kernel related.
There is a better method: the journald
daemon has all what has been logged.
You can list kernel messages with:
$ journalctl -f _TRANSPORT=kernel
That should show you anything related to the kernel and you can grep the results if need be. But there is a lot of options to refine your results (see the link or journalctl --help
).
Other examples (from the link):
Without arguments, all collected logs are shown unfiltered:
journalctl
With one match specified, all entries with a field matching the expression are shown:
journalctl _SYSTEMD_UNIT=avahi-daemon.service
If two different fields are matched, only entries matching both expressions at the same time are shown:
journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097
If two matches refer to the same field, all entries matching either expression are shown:
journalctl _SYSTEMD_UNIT=avahi-daemon.service _SYSTEMD_UNIT=dbus.service
If the separator "+" is used, two expressions may be combined in a logical OR. The following will show all messages from the Avahi service process with the PID 28097 plus all messages from the D-Bus service (from any of its processes):
journalctl _SYSTEMD_UNIT=avahi-daemon.service _PID=28097 + _SYSTEMD_UNIT=dbus.service
Show all logs generated by the D-Bus executable:
journalctl /usr/bin/dbus-daemon
Show all kernel logs from previous boot:
journalctl -k -b -1
Show a live log display from a system service apache.service:
journalctl -f -u apache