Dmesg Notes
Log levels
To set current log level, run dmesg --console-level loglevel
For intance:
dmesg --console-level debug
The log level can be checked in /proc/sys/kernel/printk
# cat /proc/sys/kernel/printk
8 4 1 7
The first of the numbers is the one we’ve just set and 8 means debug.
Here are meanings of these numbers, but for me, only the first and last are interesting:
Number | Description |
---|---|
8 | current console log level |
4 | default message log level for messages without a specific log level. |
1 | minimum log level |
7 | boot-time-default log boot-time-default log level (used during initial stages of the boot process) |
The log levels with their numbers as displayed in /proc/sys/kernel/printk:
Number | Description |
---|---|
1 | emerg |
2 | alert |
3 | crit |
4 | err |
5 | warn |
6 | notice |
7 | info |
8 | debug |
Note: The numbers in the /proc/sys/kernel/printk start from 1, while those in documentaion start at 0 which may be a bit confusing.
How to change the current console log level persistetly (so that it survives reboot)?
Edit the GRUB boot loader configuration file. For instance o GRUB boot loader configuration file needs to be edited to change the kernel log
It’s nicely explained on linuxconfig.org and on kernel.org