packets |
02-18-2012 09:45 PM |
rsyslog not logging to a correct file
I remember before I encountered this was I add logrotate to /etc/cron.dail with the ff contents:
Code:
[root@mails cron.daily]# cat logrotate
#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
[root@mails cron.daily]# ls -l logrotate
-rwxr-xr-x 1 root root 197 2012-02-16 20:58 logrotate
Now, after I week I notice that there is no log in all log files. Instead, it was log in a file with appended date
Code:
[root@mails log]# ls -ltr | grep messages
-rw------- 1 root root 184626 2009-11-16 09:21 messages-20091115
-rw------- 1 root root 364645 2009-11-24 15:27 messages-20091122
-rw------- 1 root root 5404369 2012-02-19 10:42 messages-20120216
-rw------- 1 root root 0 2012-02-19 10:45 messages
-rw------- 1 root root 1001 2012-02-19 11:10 messages-20120219
Sample above. All messages is being log in messages-20120219 instead on messages. Any hint on how I could revert it back to normal logging and just rotate per week. Below is my /etc/rsyslog.conf
Code:
Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* -/var/log/maillog
# Log cron stuff
cron.* /var/log/cron
# Everybody gets emergency messages
*.emerg *
# Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler
# Save boot messages also to boot.log
local7.* /var/log/boot.log
|