/etc/logrotate.d entry for /var/log/messages missing - Fedora 37 Server

Problem

/var/log/messages can fill /var (or root) because messages file size grows.

Cause

no base logrotate entry in /etc/logrotate.d

Related Issues

Solution

add this to file in /etc/logrotate.d

{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
/usr/local/scripts/rsyslog-rotate <<<< sends hup to syslog
endscript
}
/var/log/messages

Not all my systems have logs in /var/log.

The one that does has rsyslog installed and it also has rsyslog-logrotate installed that does the rotate of /var/log/messages.

What have you installed that is creating the /var/log/messages file?

As I never need /var/log/message etc myself I’m going to remove rsyslog.
I’m happy using the systemd journal with journalctl.

1 Like

My systems do not create a /var/log/messages file and have not done so for several fedora releases. I am sure that is the case since systemd was implemented on Workstation (at least as far back as F34).

journalctl seems to have replaced the former use of logging into /var/log/messages.
Info is in the doc file at /usr/share/doc/systemd/README.logs

Moving from Proposed Common Issues to Ask Fedora , because this doesn’t seem to be something that affects too many users (as others pointed out, /var/log/messages isn’t really used any more – at least on desktops, I haven’t checked other editions). Feel free to re-propose this as a common issue again, if we can show that it affects many people. But it needs to have a bug report attached first. Thanks.

The spins, or some of them at least, include rsyslog and rsyslog-logrotate by default. If you decide to use rsyslog on a gnome system, you can install rsyslog and it will pull in rsyslog-logrotate as a weak dependency.