"Translated from MoS article" The/var/log/messages of Linux is empty (0k), messages.0, Messages.1 is also empty

Source: Internet
Author: User
Tags syslog rsyslog

Linux/var/log/messages is empty (0k), messages.0, Messages.1 is also empty
From:
The/var/log/messages is empty, and so is the rotated log files such as messages.0, Messages.1,... (Document ID 2053885.1)

Suitable for:
Linux os-version Enterprise Linux 4.0 to Oracle Linux 7.1 with unbreakable Linux kerne l[3.8.13] [Release RHEL4 to Ol7u1 ]
Linux x86-64
Linux x86

Symptoms:
On Oracle Linux, the messages file is empty, messages.1,messages.2 and so on rotated files are also empty (rotated generated message file name depends on/etc/ logrotate.conf configuration file)

# Cd/var/logls-larth messages*-rwxrwxrwx 1 root root 0 8 22:32 messages.4-rwxrwxrwx 1 root root 0 22:32 Messa ges.3-rwxrwxrwx 1 root root 0 22:32 messages.2-rwxrwxrwx 1 root root 0 22:32 messages.1-rwxrwxrwx 1 root Roo T 0 Sep 5 22:32 messages

Reason:
The/etc/syslog.conf file has been modified, for example, by commenting out the following line:

$ grep/var/log/messages/etc/syslog.conf #*.info;mail.none;news.none;authpriv.none;cron.none/var/log/messages---- ----->>> Note the front # symbol

Solution:
1. Uncomment the related lines in/etc/syslog.conf (/etc/rsyslog.conf on OL7/RHEL7):

$ 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 take effect on the above changes

#service syslog Restart

On OL7 or RHEL7, please use the following command:

#/bin/systemctl Restart Rsyslog.service

"Translated from MoS article"/var/log/messages of Linux is empty (0k), messages.0, Messages.1 is also empty

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.