6

How does dmesg differentiate between different log levels?

I can execute dmesg -l err to see all the error logs but when I look at the data with just dmesg or just cat the /var/log/dmesg file, there is no tag/string/identifier in the log text that can differentiate err from warn.

How does dmesg store this differentiation of log levels? How does it work?

1 Answers1

11

The dmesg(1) command does not read the /var/log/dmesg file, rather, it reads /dev/kmsg which contains the necessary syslog facility and priority information.

user9517
  • 114,104
  • 20
  • 206
  • 289