Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| console_loglevel [2018/11/23 13:24] – [Files] rpjday | console_loglevel [2018/11/23 15:33] (current) – [Overview] rpjday | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Overview ===== | ===== Overview ===== | ||
| - | How to mess with '' | + | Properties of console |
| ===== Files ===== | ===== Files ===== | ||
| Line 9: | Line 9: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| - | * https:// | + | * [[https:// |
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| ==== Running system files ==== | ==== Running system files ==== | ||
| - | ==== lib/ | + | * / |
| + | * / | ||
| + | * / | ||
| + | |||
| + | ===== Kernel parameters ===== | ||
| < | < | ||
| - | config CONSOLE_LOGLEVEL_DEFAULT | + | loglevel= |
| - | int " | + | console loglevel will be printed |
| - | range 1 15 | + | also be changed with klogd or other programs. The |
| - | default " | + | loglevels are defined as follows: |
| - | help | + | |
| - | Default loglevel to determine what will be printed | + | |
| - | Setting a default here is equivalent to passing in loglevel=< | + | 0 (KERN_EMERG) |
| - | | + | 1 (KERN_ALERT) |
| - | | + | 2 (KERN_CRIT) |
| + | 3 (KERN_ERR) | ||
| + | 4 (KERN_WARNING) | ||
| + | 5 (KERN_NOTICE) | ||
| + | 6 (KERN_INFO) | ||
| + | 7 (KERN_DEBUG) | ||
| + | </ | ||
| - | Note: This does not affect the log level of un-prefixed printk() | + | < |
| - | usage in the kernel. | + | ignore_loglevel [KNL] |
| - | | + | Ignore loglevel setting |
| + | kernel | ||
| + | We also add it as printk module parameter, so users | ||
| + | could change it dynamically, | ||
| + | / | ||
| + | </ | ||
| - | config MESSAGE_LOGLEVEL_DEFAULT | + | ===== Kernel source files ===== |
| - | int " | + | |
| - | range 1 7 | + | |
| - | default " | + | |
| - | help | + | |
| - | Default log level for printk statements with no specified priority. | + | |
| - | This was hard-coded to KERN_WARNING since at least 2.6.10 but folks | + | ==== kernel/ |
| - | that are auditing their logs closely may want to set it to a lower | + | |
| - | priority. | + | |
| - | Note: This does not affect what message level gets printed on the console | + | <code> |
| - | by default. To change that, use loglevel=<x> in the kernel bootargs, | + | int console_printk[4] = { |
| - | or pick a different | + | CONSOLE_LOGLEVEL_DEFAULT, /* console_loglevel */ |
| + | MESSAGE_LOGLEVEL_DEFAULT, | ||
| + | CONSOLE_LOGLEVEL_MIN, | ||
| + | CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ | ||
| + | }; | ||
| </ | </ | ||
| Line 56: | Line 77: | ||
| #define CONSOLE_LOGLEVEL_SILENT | #define CONSOLE_LOGLEVEL_SILENT | ||
| #define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */ | #define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */ | ||
| - | #define CONSOLE_LOGLEVEL_QUIET 4 /* Shhh ..., when booted with " | ||
| #define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */ | #define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */ | ||
| #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */ | #define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */ | ||
| /* | /* | ||
| - | * Default used to be hard-coded at 7, we're now allowing | + | * Default used to be hard-coded at 7, quiet used to be hardcoded at 4, |
| - | | + | |
| */ | */ | ||
| #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT | #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT | ||
| + | #define CONSOLE_LOGLEVEL_QUIET CONFIG_CONSOLE_LOGLEVEL_QUIET | ||
| extern int console_printk[]; | extern int console_printk[]; | ||
| Line 83: | Line 104: | ||
| console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; | console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; | ||
| } | } | ||
| + | </ | ||
| + | ==== lib/ | ||
| + | |||
| + | < | ||
| + | config CONSOLE_LOGLEVEL_DEFAULT | ||
| + | int " | ||
| + | range 1 15 | ||
| + | default " | ||
| + | help | ||
| + | Default loglevel to determine what will be printed on the console. | ||
| + | |||
| + | Setting a default here is equivalent to passing in loglevel=< | ||
| + | the kernel bootargs. loglevel=< | ||
| + | value is specified here as well. | ||
| + | |||
| + | Note: This does not affect the log level of un-prefixed printk() | ||
| + | usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT | ||
| + | option. | ||
| + | |||
| + | config CONSOLE_LOGLEVEL_QUIET | ||
| + | int "quiet console loglevel (1-15)" | ||
| + | range 1 15 | ||
| + | default " | ||
| + | help | ||
| + | loglevel to use when " | ||
| + | |||
| + | When " | ||
| + | will be used as the loglevel. IOW passing " | ||
| + | equivalent of passing " | ||
| + | |||
| + | config MESSAGE_LOGLEVEL_DEFAULT | ||
| + | int " | ||
| + | range 1 7 | ||
| + | default " | ||
| + | help | ||
| + | Default log level for printk statements with no specified priority. | ||
| + | |||
| + | This was hard-coded to KERN_WARNING since at least 2.6.10 but folks | ||
| + | that are auditing their logs closely may want to set it to a lower | ||
| + | priority. | ||
| + | |||
| + | Note: This does not affect what message level gets printed on the console | ||
| + | by default. To change that, use loglevel=< | ||
| + | or pick a different CONSOLE_LOGLEVEL_DEFAULT configuration value. | ||
| </ | </ | ||