LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Enable dmesg timestamp (https://www.linuxquestions.org/questions/linux-newbie-8/enable-dmesg-timestamp-4175504053/)

BhushanPathak 05-06-2014 04:23 AM

Enable dmesg timestamp
 
I am using CentOS 6.5 64bit. I want to enable timestamp for dmesg log entries [/var/log/dmesg].

I went through this post, but recompiling the kernel is not an option for me.

Is there any other possible way of doing it [via configuration settings]?

I added the following in rsyslog.conf -

Code:

kern.*      /var/log/kern.log
It started printing some messages in kern.log, but dmesg log file still does not have timestamp.

Thanks
Bhushan Pathak

TB0ne 05-06-2014 01:14 PM

Quote:

Originally Posted by BhushanPathak (Post 5165522)
I am using CentOS 6.5 64bit. I want to enable timestamp for dmesg log entries [/var/log/dmesg].
I went through this post, but recompiling the kernel is not an option for me.

Is there any other possible way of doing it [via configuration settings]? I added the following in rsyslog.conf -

Code:

kern.*      /var/log/kern.log
It started printing some messages in kern.log, but dmesg log file still does not have timestamp.

Well, unless you enable the option in the kernel (by recompiling the kernel to have it), then it won't work. A better question is WHY isn't this an option for you? If you're the systems administrator, then this shouldn't be a problem.

If you know what you want to accomplish and know HOW to accomplish it, all that's left is for you to do it.

DJ Shaji 05-06-2014 02:14 PM

You can compile a kernel in 2 easy steps. It's the only way to enable/disable timing information on printks.

Step 1: Download the source for the kernel version you are running now, and copy the .config file belonging to that version from your /boot directory. The file would be named config-<version number>. Rename that file simply to ".config." Open a terminal in that directory, and type "make", followed by "make modules_install" and "make install"


All times are GMT -5. The time now is 02:37 AM.