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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. CentOS / RHEL 7 : Unable to start/enable iptables
  2. How to Change Time Interval to Fall Back to Secondary DNS Server in CentOS/RHEL
  3. 5 Useful Command Examples to Monitor User Activity under Linux
  4. CentOS / RHEL 6,7 : How to use yum history to roll back a yum update
  5. How to Compress and Decompress .bz2 files in Linux Using bzip2 Command
  6. CentOS / RHEL 7 : How to modify Network Interface names
  7. How to Access VNC Server Through A Web Browser in CentOS/RHEL
  8. CentOS / RHEL 7 : Tips on Troubleshooting NTP / chrony Issues
  9. cp: omitting directory – error while copying a directory in Linux
  10. How to Resize / Expand a Btrfs Volume / Filesystem

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary