1

One of our servers has a recurring error message for Logrotate.

/etc/cron.daily/logrotate: ERROR No file found for /usr/local/Zend/apache2/logs/error_log

Log rotation is working normally for the folder that it should look into. The error mentions a folder that is not monitored.

/var/log/apache2/*.log /var/log/apache2/*/*.log {
  daily
  rotate 50
  compress
  delaycompress
  missingok
  notifempty
  sharedscripts
  postrotate
        /usr/local/Zend/apache2/bin/apachectl graceful
  endscript
}

When I grep for error_log in the apache folder I find the following:

conf/extra/httpd-ssl.conf: ErrorLog "/usr/local/Zend/apache2/logs/error_log"
conf/extra/httpd-vhosts.conf: ErrorLog /www/phones/logs/error_log

Both these folders are not monitored by the httpd logrotate script. We don't use SSL, so there is no log there. The phones log is there but it not rotated currently. I've grepped the logrotate.d folder to see if some other logrotate config file monitors the apache folder, but no result.

Below the contents of /etc/logrotate.conf

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0600 root utmp
    rotate 1
}

Output of /usr/sbin/logrotate /etc/logrotate.conf -d

reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file dirmngr
reading config info for /var/log/dirmngr/dirmngr.log 
reading config file fail2ban
reading config info for /var/log/fail2ban.log 
reading config file httpd
reading config info for /var/log/apache2/*.log /var/log/apache2/*/*.log 
reading config file ppp
reading config info for /var/log/ppp/connect-errors 
reading config file psacct
reading config info for /var/account/pacct 
reading config file rpm
reading config info for /var/log/rpmpkgs 
reading config file rsyslog
reading config info for /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron 
reading config file snmpd
reading config info for /var/log/snmpd.log 
reading config file wpa_supplicant
reading config info for /var/log/wpa_supplicant.log 
reading config file yum
reading config info for /var/log/yum.log 
reading config info for /var/log/wtmp 
reading config info for /var/log/btmp 

Handling 12 logs

rotating pattern: /var/log/dirmngr/dirmngr.log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/dirmngr/dirmngr.log
  log /var/log/dirmngr/dirmngr.log does not exist -- skipping

rotating pattern: /var/log/fail2ban.log  30720 bytes (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/fail2ban.log
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/apache2/*.log /var/log/apache2/*/*.log  after 1 days (50 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/access.log
  log does not need rotating
considering log /var/log/apache2/voip-access.log
  log does not need rotating
considering log /var/log/apache2/voip-error.log
  log does not need rotating
considering log /var/log/apache2/zoo-access.log
  log does not need rotating
considering log /var/log/apache2/zoo-error.log
  log does not need rotating
considering log /var/log/apache2/error.log
  log does not need rotating
considering log /var/log/apache2/trs_error.log
  log does not need rotating
considering log /var/log/apache2/market-access.log
  log does not need rotating
considering log /var/log/apache2/market-error.log
  log does not need rotating
considering log /var/log/apache2/shop/staging-access.log
  log does not need rotating
considering log /var/log/apache2/shop/staging-error.log
  log does not need rotating
considering log /var/log/apache2/shop/shop-access.log
  log does not need rotating
considering log /var/log/apache2/shop/shop-error.log
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/ppp/connect-errors  after 1 days (5 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/ppp/connect-errors
  log /var/log/ppp/connect-errors does not exist -- skipping

rotating pattern: /var/account/pacct  after 1 days (31 rotations)
empty log files are not rotated, old logs are removed
considering log /var/account/pacct
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/rpmpkgs  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/rpmpkgs
  log does not need rotating

rotating pattern: /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron  weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/messages
  log does not need rotating
considering log /var/log/secure
  log does not need rotating
considering log /var/log/maillog
  log does not need rotating
considering log /var/log/spooler
  log does not need rotating
considering log /var/log/boot.log
  log does not need rotating
considering log /var/log/cron
  log does not need rotating
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/snmpd.log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/snmpd.log
  log /var/log/snmpd.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/wpa_supplicant.log  30720 bytes (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/wpa_supplicant.log
  log /var/log/wpa_supplicant.log does not exist -- skipping

rotating pattern: /var/log/yum.log  yearly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/yum.log
  log does not need rotating

rotating pattern: /var/log/wtmp  monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/wtmp
  log does not need rotating

rotating pattern: /var/log/btmp  monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
  log /var/log/btmp does not exist -- skipping

What causes this error? I have no idea where to look.

1

I'll start from the beginning:

  1. Check the call for logrotate inside /etc/cron.daily/logrotate to see if some special conf file is used. Traditionally /etc/logrotate.conf is used.
  2. Inside your .conf file, look for include directive. You should have one: include /etc/logrotate.d and grep this directory for error_log. Also, check that there is no system specific logs declared inside the .conf file.

Have you found anything?

If you didn't, I suggest that you run the logrotate command found inside the /etc/cron.daily/logrotate, adding the -d switch to it.

  • The normal logrotate.conf is used. I've copied the contents in the question. Nothing refers to error_log. I don't see the btmp logfile from the logrotate.conf file in /var/log. – SPRBRN Jan 21 '15 at 12:54
  • Running /usr/sbin/logrotate /etc/logrotate.conf -d results in lots of output, but no mention of error_log and nothing needs rotating. It mentions the missing btmp, and then skips it. – SPRBRN Jan 21 '15 at 13:02
  • 1
    @SPRBRN sorry I haven't explained myself very well. What I meant, was: inside the /etc/cron.daily/logrotate script you will have a call to the logrotate binary. Mine is /usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1. If you have the same, you should launch /usr/sbin/logrotate -d /etc/logrotate.conf – maiki Jan 21 '15 at 13:04
  • Thanks! I saw the mistake myself, have changed my comment, but didn't find anything there. – SPRBRN Jan 21 '15 at 13:06
  • 1
    @SPRBRN that's awkward. Please post the output of the debug command. – maiki Jan 21 '15 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.