• 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

The /var/log/messages is empty, and so are the rotated log files such as messages.0, messages.1

by admin

The Problem

On CentOS/RHEL system, the messages file is empty, and so are the rotated files (exact rotated names depends on the /etc/logrotate.conf configuration file), e.g. :

# cd /var/log
ls -larth messages*
-rwxrwxrwx 1 root root 0 Aug 8 22:32 messages.4
-rwxrwxrwx 1 root root 0 Aug 15 22:32 messages.3
-rwxrwxrwx 1 root root 0 Aug 22 22:32 messages.2
-rwxrwxrwx 1 root root 0 Aug 29 22:32 messages.1
-rwxrwxrwx 1 root root 0 Sep 5 22:32 messages

The Solution

The /etc/syslog.conf configuration file has been altered, e.g. by commenting this line which is shipped with a default CentOS/RHEL installation :

$ grep /var/log/messages /etc/syslog.conf 
#*.info;mail.none;news.none;authpriv.none;cron.none /var/log/messages

1. Uncomment that line or rollback any other changes to the logging configuration of the messages that should go to /var/log/messages in /etc/syslog.conf (/etc/rsyslog.conf on CentOS/RHEL 6,7)

$ grep /var/log/messages /etc/syslog.conf 
*.info;mail.none;news.none;authpriv.none;cron.none /var/log/messages

2. Restart the syslog service to pick up the changes.

# service syslog restart        ### For CentOS/RHEL 5
# service syslog restart        ### For CentOS/RHEL 6,7

On CentOS/RHEL 7,

# systemctl restart rsyslog.service

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to troubleshoot NFS transfer latency issues using “nfsiostat” in CentOS / RHEL
  2. How to allow all traffic from a server using firewalld in CentOS/RHEL
  3. Sample /etc/mke2fs.conf file
  4. How to Install Apache, MariaDB, and PHP (FAMP) stack on FreeBSD 11
  5. CentOS / RHEL : How to view the commands executed in yum history command output
  6. Understanding /etc/login.defs file
  7. How to Find and Delete Empty Directories and Files in Linux
  8. locate Command Examples in Linux
  9. UbuntuDDE new upcoming Linux distribution
  10. Red Hat / CentOS : How to create interface / NIC bonding

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright