You want to direct kernel messages to your serial console and to a logfile so that you can follow along in real-time, and also have a logfile to study later. How do you do this?
Configure /etc/syslog.conf to route your kernel messages where you want them to go:
kern.* -/var/log/kern.log kern.* /dev/console kern.* @xena
This sends all kernel messages to three different locations. The first one is a local file, the second one is your serial console, and the third one is the remote logging server Xena.
There will be at least on default kern
entry, so make sure you find and change
or delete it if it doesn't suit your logging scheme.
You may fine-tune your logging because syslog supports eight different severity levels:
debug, info, notice, warning, err, crit, alert, emerg
When you select one of these, you also get all the higher-priority messages as well. This example:
kern.crit /dev/console
sends crit, alert
, and
emerg
messages to the serial
console.
You must restart klogd after changing this file. On Debian, use this command:
# /etc/init.d/klogd restart
Fedora uses this command:
# /etc/init.d/sysklogd restart
On Linux, the system logging daemon is actually two daemons: sysklogd and klogd. klogd is the kernel logging daemon. Debian gives each one its own init file; Fedora starts them both from the same file.
man 5 syslog.conf