Why does Ubuntu store the daemon logs on /var/log/daemon.log.1 instead of /var/log/daemon.log?
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 gzip
s 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?
Related videos on Youtube
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, 2022Comments
-
Pallab Gain over 1 year
Trying to
cat /var/log/daemon.log
doesn't produce any output, whilecat /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 calledadmin
-
Pallab Gain over 11 yearsHey, 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 over 11 yearsWell, I'm using Debian, of which Ubuntu is a derivation. Perhaps Ubuntu is using something different with logging now.