created on | August 20, 2025 |
Messages sent by the kernel fall into 8 categories of log levels 0 to 7, with log level 0/KERN_EMERG having the highest priority and log level 7/KERN_DEBUG having the lowest priority:
log level | description | |
---|---|---|
0 | KERN_EMERG | system is unusable |
1 | KERN_ALERT | action must be taken immediately |
2 | KERN_CRIT | critical conditions |
3 | KERN_ERR | error conditions |
4 | KERN_WARNING | warning conditions |
5 | KERN_NOTICE | normal but significant condition |
6 | KERN_INFO | informational |
7 | KERN_DEBUG | debug-level messages |
The system has 4 log levels configured in :
All Kernel Messages with a log level smaller than the console log level will be printed to the console.
The log levels can be displayed with :
For the configuration above, all message with log level 3/KERN_ERR will be printed to the console.
The above configuration can be set with: .
When setting the console log levels this way, not all console levels have to be provided. To just set the current console log level to ‘4’, suffices.
The current console level, first field, can also be set with , using either the numeric log level or the string log levels in the table above, lower cased, without the “KERN_” part. However, is not equivalent to . sets the log level 7 for the current console log level in :
As anything in , this configuration is not persistent. The default console log level, fourth field, which is also used at boot time, can be set with the kernel command line parameter , i.e.
The console log levels can be configured with , if contains the respective line, i.e.:
The syntax is . If the config file is omitted like in above, is used.