LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 05-24-2005, 06:16 AM   #1
meihua_t
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 4

Rep: Reputation: 0
Question Is there any configuration for /var/log/messages of RHEL3


Hi

One of my customer is using RedHat Enterprise Linux 3. We are having problem of viewing few days ago information of /var/log/messages.

For example:
I log in and cat /var/log/messages today (24/5), the /var/log/messages only display today's information and time. It didn't show 23/5 or the day before that. I have tried to view at /var/log/messages.0 or 1 or 2 or 3, which it suppose to capture old information within a week, but it gives me the same result, I couldn't find the 23/5 day of /var/log/messages.

Hence, I would like to know whether there is any configuration to set to display only 1 day information in /var/log/messages.

Thanks.
 
Old 06-01-2005, 03:30 PM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
The logrotate package may be clearing the log everyday. Check /etc/logrotate.d/syslog and see if there is something that rotates the logs daily or whatever.
 
Old 06-08-2005, 10:01 AM   #3
baijumichael
LQ Newbie
 
Registered: May 2005
Posts: 2

Rep: Reputation: 0
By default RHEL3 logrotate clears the /var/log/message and similar logs every week. This renames most recent weekly log to <log file>.1 and creates new log. It maintais 4 weeks logs using this. You can also customise this using /etc/logrotate.conf and adding individual file configuration for your file.


My recommendation : If syslog messages on a particular subsystem or daemon is to be captured for a long time , configure /etc/syslog.conf and capture them to a seperate log file. You can easily download manuals for them. or read manpages for syslog.conf.

Thanks,

Byju Michael
 
Old 06-13-2005, 10:06 PM   #4
meihua_t
LQ Newbie
 
Registered: May 2005
Location: Malaysia
Posts: 4

Original Poster
Rep: Reputation: 0
Dear Donboy,

I have checked on the /etc/logrotate.d/syslog, however it is a script which I cannot understand. I would appreciate if you could highlight to me whether it has stated any logs for daily or whatever.

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill –HUP ‘cat/var/run/syslogd.pid 2> /dev/null’ 2> /dev/null || true
endscript
}


Thanks.
 
Old 06-13-2005, 11:45 PM   #5
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
This particular script isn't showing how frequently your logs are rotated. Instead, they are being inherited from /etc/logrotate.conf. But you can put commands in this statement that will specify how often these particular log files are rotated.

Maybe you want to change your script to be more like this...

Code:
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
	sharedscripts
	daily
	rotate 7
	compress    
	postrotate
	/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
	endscript
}
This will rotate the log files daily and keep 7 days worth of old logs. If you don't want the old archives to be zipped, just remove the word "compress" from this block of commands.

Check "man logrotate" for more info. Right after the examples in the man pages, you'll see all these commands that are mystifying you.
 
  


Reply



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
what does messages suppressed in /var/log/messages mean saavik Linux - Networking 2 05-07-2008 02:31 PM
Redirecting the kernel messages to file other than /var/log/messages jyotika_b83 Linux - General 3 04-28-2005 06:39 PM
From where am i getting error messages to /var/log/messages? prabhuacsp Programming 3 02-16-2005 08:59 AM
From where am i getting error messages to /var/log/messages? prabhuacsp Linux - Networking 1 02-16-2005 12:34 AM
/var/log/messages full of these messages. Should I be concerned? mdavis Linux - Security 5 04-16-2004 10:08 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 03:16 AM.

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
Open Source Consulting | Domain Registration