• 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. Ubuntu Linux – OpenShot Video Editor
  2. Change default kernel (boot with old kernel) – CentOS/RHEL/OEL 7
  3. lspci Command Examples in Linux
  4. nsnake: command not found
  5. How to find if NUMA configuration is enabled or disabled?
  6. dpkg-deb Command Examples in Linux
  7. aws-shell: command not found
  8. “java” command does not run the JVM that has been installed
  9. CentOS / RHEL 7 : Enable NTP to start at boot after fresh install (disable chrony)
  10. Archiving Failures with ORA-16038, ORA-19504, ORA-00312

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright