LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-06-2012, 10:31 AM   #1
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Rep: Reputation: Disabled
how to keep more access.log files in squid


Hi..Everyone,
By default squid is keeping only 3 files i.e
Code:
#ls /var/log/squid3/access.log* | sort
/var/log/squid3/access.log
/var/log/squid3/access.log.1
/var/log/squid3/access.log.2.gz
I want to keep at least 7 files which will be having 7 days logs like access.log, access.log.1, access.log.2.gz, access.log.3.gz, access.log.4.gz and so on. So could anybody please advise that how can I achieve this. Thanks in advance for your kind reply.
 
Old 03-06-2012, 12:12 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,900

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Hi,

I guess it's logrotate that rotates logs. If that's the case open /etc/logrotate.d/squid (or something like that) and edit it accordingly.

Regards
 
1 members found this post helpful.
Old 03-06-2012, 12:22 PM   #3
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Original Poster
Rep: Reputation: Disabled
Hi..bathory,
Thanks for the reply, here is output of that file
Code:
#cat /etc/logrotate.d/squid3
#
#	Logrotate fragment for squid3.
#
/var/log/squid3/*.log {
	daily
	compress
	delaycompress
	rotate 2
	missingok
	nocreate
	sharedscripts
	postrotate
		test ! -e /var/run/squid3.pid || /usr/sbin/squid3 -k rotate
	endscript
}
Here should I change to weekly instead of daily and rotate 7 instead of 2? Isn't it? And please let me know if any other needs to be changed.

Last edited by roopakl; 03-06-2012 at 12:25 PM.
 
Old 03-06-2012, 12:45 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,900

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Quote:
Here should I change to weekly instead of daily and rotate 7 instead of 2? Isn't it? And please let me know if any other needs to be changed.
Right. Well, if you want to keep 7 log files, then use rotate 6

Regards
 
1 members found this post helpful.
Old 03-06-2012, 08:51 PM   #5
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Original Poster
Rep: Reputation: Disabled
Thank you very bathory, I will check it out and let you know the status.
 
  


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
squid /var/log/squid/access.log problems fahadabdillahi Linux - Server 0 12-17-2010 02:10 AM
Can SQUID log skype calls,voip,chat programs in access.log revinking Linux - Newbie 6 07-27-2008 02:14 PM
Squid : Multiple access log files (ACL Wise) suhas! Linux - Server 0 09-24-2007 01:43 AM
My squid won't fill /var/log/squid/access.log linuxlah Linux - General 5 10-06-2003 11:51 PM
Squid access.log files davebarnes Linux - Networking 1 10-27-2002 05:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:59 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration