Linux - How to enable timestamp for dmesg, Enable timestamp for dmesg logs

How to enable timestamp for dmesg

Logs that are written into dmesg kernel ring buffer do not have time stamp by default. For troubleshooting purposes, it can be helpful to have time stamps for logs that are written into dmesg kernel ring buffer.

Follow the below steps to enable timestamp in dmesg log, Enable dmesg timestamp in runtime
  # echo 1 > /sys/module/printk/parameters/time 

  # cat /sys/module/printk/parameters/time 
    
    Y

Send a test message to dmesg log
  # echo \"Love U Dear\" > /dev/kmsg 

  # dmesg | tail -n 5 

    [16952.759416] Love U Dear

The topic on Linux - How to enable timestamp for dmesg is posted by - Math

Hope you have enjoyed, Linux - How to enable timestamp for dmesgThanks for your time

Tech Bluff