Thursday, August 29, 2013

Configure log-level of messages sent to console

To configure log-level of messages sent to console one can do as it said in /etc/sysctl.conf

# Uncomment the following to stop low-level messages on console
kernel.printk = 3 4 1 3

The four values in kernel.printk denote:
  • console_loglevel
  • default_message_loglevel
  • minimum_console_loglevel
  • default_console_loglevel respectively.
Following log levels are valid (man syslog):

#define KERN_EMERG    "<0>"  /* system is unusable               */
#define KERN_ALERT    "<1>"  /* action must be taken immediately */
#define KERN_CRIT     "<2>"  /* critical conditions              */
#define KERN_ERR      "<3>"  /* error conditions                 */
#define KERN_WARNING  "<4>"  /* warning conditions               */
#define KERN_NOTICE   "<5>"  /* normal but significant condition */
#define KERN_INFO     "<6>"  /* informational                    */
#define KERN_DEBUG    "<7>"  /* debug-level messages             */

No comments:

Post a Comment