Squid3 access.log rotation



  • Maybe I’m looking at this all wrong because of experience with sqiud2. But I can’t seem to get squid3 to rotate the access.log file.

    I have “logfile_rotate 1” in the squid.conf file and there is cron job to rotate the log. I’ve even manually ran /usr/local/sbin/squid -k rotate

    Any ideas?

    What is everyone else doing for their squid3 log rotation and retention?



  • No one using squid3 out there? I can’t be the only one



  • Hi cino,

    I think there maybe a missing conf on bsd rotate scripts(if any on pfsense)

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590833



  • Thanks Marcelloc! I take a look and see if maybe I can copy it over to my box

    Stephen



  • I went ahead and installed logrotate and that seem to do the trick… just have to tweak it now… thank you again!

    I somewhat followed this how-to http://teklimbu.wordpress.com/2007/10/16/managing-your-linuxunix-log-files-using-logrotate/

    now i just to make sure it doesn’t lose data when LightSquid runs

    Stephen



  • I tried changing the permissions on the log files chmod 777 /var/squid/logs/* and then did squid -k rotate and it was able to rotate.

    Since everything is owned by user proxy it looks like the squid user doesn’t have permission to create and move files in /var/squid



  • thanks apoirie!! Not sure if I had tried that already but i’ll give it a shot… If this works, I’ll probably keep logrotate in place for now since i have it setup to keep 90days of web logs, 7 days of cache.log and setup for squidguard also.



  • The permission change worked initially, but there appears to be something else going wrong with rotating the log files.  My current speculation is that it has something to do with the size of the log file that is getting rotated as mine can easily hit 1Gb in size in a day.



  • Something that worked this time, who knows why.  I stopped the squid service and then started it usingsquid -d 9to get it to log what was going on to the console.  In a separate console I ran```
    squid -k rotate

    
    ***EDIT****
    Found same thing was occurring on a second pfsense box, same version, same installed add-ons, much less traffic.  Did the commands listed above and rotate finally worked again.  I'm also killing the squid -d 9 process that I started for doing the log rotation and starting squid again through the web console.

Locked
 

© Copyright 2002 - 2018 Rubicon Communications, LLC | Privacy Policy