Description of kernel.printk values

Sysctl settings are documented in Documentation/sysctl/*.txt in the kernel source tree. On Debian, install linux-doc to have the documentation in usr/share/doc/linux-doc-*/Documentation/ (most distributions have a similar package). From Documentation/sysctl/kernel.txt:

The four values in printk denote: console_loglevel, default_message_loglevel, minimum_console_loglevel and default_console_loglevel respectively.

These values influence printk() behavior when printing or logging error messages. See man 2 syslog for more info on the different loglevels.

  • console_loglevel: messages with a higher priority than this will be printed to the console
  • default_message_loglevel: messages without an explicit priority will be printed with this priority
  • minimum_console_loglevel: minimum (highest) value to which console_loglevel can be set
  • default_console_loglevel: default value for console_loglevel

I don't find any clear prose explanation of what default_console_loglevel is used for. In the Linux kernel source, the kernel.printk sysctl sets console_printk. The default_console_loglevel field doesn't seem to be used anywhere.


Description of kernel.printk values

  • "0" → Emergency messages, system is about to crash or is unstable pr_emerg
  • "1" → Something bad happened and action must be taken immediately pr_alert
  • "2" → A critical condition occurred like a serious hardware/software failure pr_crit
  • "3" → An error condition, often used by drivers to indicate difficulties with the hardware pr_err
  • "4" → A warning, meaning nothing serious by itself but might indicate problems pr_warning
  • "5" → Nothing serious, but notably nevertheless. Often used to report security events. pr_notice
  • "6" → Informational message e.g. startup information at driver initialization pr_info
  • "7" → Debug messages pr_debug, pr_devel if DEBUG is defined
  • KERN_DEFAULT "d" The default kernel loglevel
  • KERN_CONT "" "continued" line of log printout (only done after a line that had no enclosing)