• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6,7 : How to increase system log message verbosity (rsyslogd)

by admin

The Linux system log daemon is responsible for logging system messages. Starting RHEL 6, The system log daemon/service and its configuration file is rsyslogd – /etc/rsyslog.conf. The post describes how to modify CentOS / RHEL 6,7 system log message verbosity.

Verbosity level for rsyslogd

Each line in the configuration file /etc/rsyslog.conf defines a rule consisting of two whitespace-separated fields i.e. a selector (or filter) field and an action field.

– The selector field specifies a pattern of facilities and priorities.
– The action field specifies the target for messages matched by the selector i.e. a file (log), named pipe (fifo), tty (terminal), network address, etc.

facilities

authpriv security/authorization messages (private)
cron clock daemon (crond and atd messages)
daemon messages from system daemons without separate facility
kern kernel messages
local[0-7] reserved for local system use (see below)
lpr printer messages (used by JetDirect cards)
mail messages from mail daemons
news USENET news subsystem messages
syslog messages generated internally by syslogd
user generic user-level messages
uucp UUCP subsystem messages

Priorities / Severities

0 emerg system is unusable
1 alert action must be taken immediately
2 crit critical conditions
3 err error conditions
4 warning warning conditions
5 notice normal, but significant, condition
6 info informational message
7 debug debug-level message

Following is a default sample of an RHEL 7 /etc/rsyslog.conf file. The first line instructs the syslog daemon (syslogd) to log everything of level info or higher (excluding mail, authpriv and cron facility message) to the /var/log/messages file.

cat /etc/rsyslog.conf
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
authpriv.*                                              /var/log/secure
mail.*                                                  -/var/log/maillog
cron.*                                                  /var/log/cron
*.emerg                                                 *
uucp,news.crit                                          /var/log/spooler
local7.*                                                /var/log/boot.log

Increasing default syslog message verbosity

1. To increase the default syslog message verbosity e.g. from info to debug level, change the relevant syslog configuration file entry e.g.:

from:

*.info;mail.none;authpriv.none;cron.none           /var/log/messages

to:

*.debug;mail.none;authpriv.none;cron.none          /var/log/messages

2. To send debug level messages (but not messages of other levels) for all facilities to virtual console 9 (/dev/tty9), add the following syslog configuration file entry:

*.=debug                      /dev/tty9

3. When making changes to the system log configuration file, a restart of the rsyslogd service (or system reboot) is required for changes to take effect e.g.:

For RHEL 6 :

# service rsyslogd restart

For RHEL 7 :

# systemctl restart rsyslog

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. authconfig Command Examples in Linux
  2. How to Debug systemd boot process in CentOS/RHEL 7 and 8
  3. gbp: command not found
  4. atop Command Examples in Linux
  5. cargo test: Execute the unit and integration tests of a Rust package
  6. Linux OS Service ‘httpd’
  7. namei: command not found
  8. Shell Script to Find Network Interface Link Status and Speed (CentOS/RHEL)
  9. findfs: command not found
  10. Downloading RPM Packages with dependencies [ yumdownloader Vs yum-downloadonly Vs repoquery]

You May Also Like

Primary Sidebar

Recent Posts

  • diffstat: Create a histogram from the output of the diff command
  • diffoscope: Compare files, archives, and directories
  • diff-pdf: Tool for comparing two PDFs
  • dict: Command line dictionary using the DICT protocol

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright