Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Pretty much what the title says. 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

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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|improve this answer
    
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. –  NlightNFotis Sep 2 '12 at 15:29
    
Well, I'm using Debian, of which Ubuntu is a derivation. Perhaps Ubuntu is using something different with logging now. –  ultrasawblade Sep 2 '12 at 20:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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