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/kmsgon BSDs,/proc/kmsgon 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
klogddaemon can be used in addition to AxoSyslog to read kernel messages and forward them tosyslog-ng.klogdused to preprocess kernel messages to resolve symbols and so on, but as this is deprecated byksymoopsthere is really no point in running bothklogdand AxoSyslog in parallel. Also note that running two processes reading/proc/kmsgat the same time might result in dead-locks. -
When using AxoSyslog to read messages from the
/proc/kmsgfile, 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));