Log files (/var/log/messages) written by rsyslog in RHEL7 are empty and logger commands do nothing

Solution Verified - Updated -

Issue

  • rsyslog not writing to /var/log/messages in RHEL 7.

  • On a RHEL 7 machine, the logger command does not generate a new log entry in /var/log/messages -- instead, it's empty except for messages from rsyslogd itself, e.g.:

    ~]# cat /var/log/messages
    Jan 26 11:32:45 r72 rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="1704" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
    ~]# systemctl restart rsyslog
    ~]# logger testing testing
    ~]# cat /var/log/messages
    Jan 26 11:32:45 r72 rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="1704" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
    Jan 26 11:33:10 r72 rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="1704" x-info="http://www.rsyslog.com"] exiting on signal 15.
    Jan 26 11:33:10 r72 rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="1792" x-info="http://www.rsyslog.com"] start
    
  • On a RHEL 7 machine, the logger command generates new log entries in the systemd journal ...

    ~]# journalctl -fn0 &
    [1] 1884
    -- Logs begin at Tue 2016-01-26 10:26:17 EST. --
    ~]# logger testing logger
    Jan 26 11:38:42 r72.example.com root[1885]: testing logger
    

    However, the same messages are not showing up in rsyslog's /var/log/messages file.

    ~]# tail -fn0 /var/log/messages &
    [1] 1913
    ~]# logger testing logger again
    ~]#
    

Environment

  • Red Hat Enterprise Linux 7
  • rsyslog with customized /etc/rsyslog.conf file
  • systemd-journald

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content