LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-18-2012, 10:45 PM   #1
packets
Member
 
Registered: Oct 2005
Posts: 310

Rep: Reputation: 30
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
 
Old 02-19-2012, 06:40 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531Reputation: 3531
There is nothing in /etc/rsyslog.conf or /etc/cron.daily/logrotate (both contain default values) that suggest rotating log files according to some non-standard scheme. Search /etc/logrotate.d/ for that.
 
Old 03-10-2012, 09:11 AM   #3
packets
Member
 
Registered: Oct 2005
Posts: 310

Original Poster
Rep: Reputation: 30
Ok. Got a free time so if someone stumble to this post, then you might just scratch your head.

I got a wrong entry on my logrotate.conf. My kill -HUP syslogd should be kill -HUP rsyslogd

:-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsyslog logging tftpd-hpa logs to mysql realnoname Linux - General 0 11-06-2011 12:12 PM
[SOLVED] syslog remote logging with rsyslog server Chenchu Linux - Newbie 3 09-17-2011 02:34 PM
[SOLVED] How to create a separate logfile for host sending logging to rsyslog rytec Linux - Server 4 02-17-2011 12:03 PM
Rsyslog not logging routers messages dman777 Linux - Software 9 01-31-2011 06:08 AM
LXer: Enhanced Logging With rsyslog On Debian Etch And phpLogcon For Viewing LXer Syndicated Linux News 0 10-03-2007 08:40 PM


All times are GMT -5. The time now is 09:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration