Notes on reading kernel messages
Note the following points when reading kernel messages on various platforms.
-
The kernel usually sends log messages to a special file (
/dev/kmsg
on BSDs,/proc/kmsg
on Linux). Thefile()
driver reads log messages from such files. The AxoSyslog application can periodically check the file for new log messages if thefollow-freq()
option is set. -
On Linux, the
klogd
daemon can be used in addition to AxoSyslog to read kernel messages and forward them tosyslog-ng
.klogd
used to preprocess kernel messages to resolve symbols and so on, but as this is deprecated byksymoops
there is really no point in running bothklogd
and AxoSyslog in parallel. Also note that running two processes reading/proc/kmsg
at the same time might result in dead-locks. -
When using AxoSyslog to read messages from the
/proc/kmsg
file, AxoSyslog automatically disables thefollow-freq()
parameter to avoid blocking the file. -
To read the kernel messages on HP-UX platforms, use the following options in the source statement:
file("/dev/klog" program-override("kernel") flags(kernel) follow-freq(0));