LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 09: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, 11:12 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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, 11:22 AM   #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 11:25 AM.
 
Old 03-06-2012, 11:45 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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, 07: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



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

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

All times are GMT -5. The time now is 07:30 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