Can't log to rsyslog with facility "kern" using logger command.
Issue
- How can I write or generate a message with the kern facility via rsyslog ?
- Is it possible to write a message with
kernfacility to some file using theloggercommand? - When I run the command
logger -p kern.info test, the log message is written to file with theuserfacility instead of the definedkernfacility.Further more, the message is saved to the/var/log/messagesfile, instead of to the/var/log/kern.logfile. As you can see with this one-liner, the message is saved to disk with theuserfacility, and to themessagesfile, while thekern.logis not updated.
[root@server ~]# date && logger -p kern.info "Now is: $(date)" && tail -1 messages && tail -1 kern.log
Mon Jan 25 18:38:24 CET 2016
Jan 25 18:38:24 <user.info> boom eu2246: Now is: Mon Jan 25 18:38:24 CET 2016
Jan 25 18:20:01 <kern.debug> boom kernel: SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
To send messages with the kern facility to a separate log file, we use this configuration: kern.* /var/log/kern.log.
Environment
- Red Hat Enterprise Linux (all versions)
- rsyslog
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.