Klogd and Syslogd logs show different timestamps in message logs
Issue
-
Why the timestamps are different for syslogd and klogd logs and how to sync them back?
-
Present system time as per "date" command.
# date
Thu May 23 08:20:40 EDT 2013
- Generate log via klogd and syslogd with below commands.
# logger "Test message via logger."
# echo "Test message via klogd." > /dev/kmsg
- Logs show different timestamps. Klogd is not referring to system time as per data command output.
# tail -n 2 /var/log/messages
May 23 08:21:45 009 logger: Test message via logger.
May 23 12:21:52 009 kernel: Test message via klogd.
- After restarting both the services issue appears to have gone.
# /etc/init.d/syslog stop
Shutting down kernel logger: [ OK ]
Shutting down system logger: [ OK ]
# /etc/init.d/syslog start
Starting system logger: [ OK ]
Starting kernel logger: [ OK ]
# logger "Test message via logger."
# echo "Test message via klogd." > /dev/kmsg
# tail -n 2 /var/log/messages
May 23 08:23:14 009 logger: Test message via logger.
May 23 08:23:19 009 kernel: Test message via klogd.
Environment
- Red Hat Enterprise Linux 5.6
- Klogd
- Syslogd
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
