Why does Ubuntu store the daemon logs on /var/log/daemon.log.1 instead of /var/log/daemon.log?

9,419

The *.1, *.2.gz, etc. files are generated by logrotate, normally invoked by cron once a day IIRC. logrotate is designed to prevent log files from getting too large. It gzips the file after "1". Programs won't write to the *.1, etc. files on their own.

Are you sure that /var/log/daemon.log.1 is receiving new data? What's the timestamp of the last line in the file?

It sounds like your syslog process is not running or has crashed. Did you run out of disk space?

Share:
9,419

Related videos on Youtube

Pallab Gain
Author by

Pallab Gain

I am Fotis Koutoulakis, a Computer Scientist mostly interested in Programming Languages, both theory and implementation. Secondary interests of mine include complexity theory, machine learning and distributed systems.

Updated on September 18, 2022

Comments

  • Pallab Gain
    Pallab Gain over 1 year

    Trying to cat /var/log/daemon.log doesn't produce any output, while cat /var/log/daemon.log.1 does. Why do daemons store logs to the /var/log/daemon.log.1 file instead of /var/log/daemon.log? Is there a specific reason they are storing on the other file?

    NOTE: ls -l /var/log shows both of those files have the same permissions and both are owned by a user called admin

  • Pallab Gain
    Pallab Gain over 11 years
    Hey, thank you for the answer, there is a /var/log/daemon.log.2 file too. I am not running out of space on the computer i noticed this behavior. However, I am now using another computer, again with Ubuntu 12.04 as the main OS, and I noticed that it doesn't have a /var/log/daemon.log at all.
  • LawrenceC
    LawrenceC over 11 years
    Well, I'm using Debian, of which Ubuntu is a derivation. Perhaps Ubuntu is using something different with logging now.