Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a way to change the format of timestamp in kernel logs?

It was something like 2012-08-27T8:54:35.939421+03:00 now, I also checked sysctl -a | grep log, nothing found really.

share|improve this question
    
jftr the timestamp are absolute numbers since boot and don't have anything to do with your system clock –  Ulrich Dangel Sep 27 '12 at 9:53
add comment

1 Answer

up vote 2 down vote accepted

No, see the kernel code in kernel/printk.c, it's hardcoded as:

sprintf(tbuf, "[%5lu.%06lu] ", (unsigned long) t, nanosec_rem / 1000)

All you can do is enable/disable that timestamp. You can have whatever reads /proc/kmsg (syslog, klog...) add the timestamp itself.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.