[squid-users] How do I rotate access.log?

Alex Rousskov rousskov at measurement-factory.com
Tue Dec 29 18:37:20 UTC 2020


On 12/29/20 12:33 PM, roee klinger wrote:

> I am using a Raspberry Pi and the latest version of Squid which I
> installed from apt.
> 
> In my cache.log, here are all my logging and rotation-related messages:
> 
> 2020/12/29 17:37:14 kid1| logfileRotate: daemon:/var/log/squid/access.log
> 2020/12/29 17:37:14 kid1| logfileRotate: daemon:/var/log/squid/access.log
> 2020/12/29 17:37:14 kid1| Logfile: opening log daemon:/var/log/squid/access.log
> 2020/12/29 17:37:14 kid1| Logfile Daemon: opening log /var/log/squid/access.log
> 2020/12/29 17:37:14 kid1| Store logging disabled

What is your Squid version? "squid --version" may answer that question.

The "opening log" lines in your cache.log look strange. I do not see
them in my tests, but my version of Squid is probably different from
yours. If you shut down Squid completely, then remove all cache.log
files, then start Squid, and then rotate once, what logging and rotation
messages do you see in all the resulting cache.log files (including the
rotated ones)? Do not shut down or restart Squid until you collect all
those lines. Include all lines that mention "log" or "rotate".

Do you see transactions getting logged to access.log?

Is the logging daemon running? "ps aux | grep 'logfile[-]daemon'" or a
similar command may answer that question.

How do you know that your access.log was _not_ rotated?

Alex.



> On Tue, Dec 29, 2020 at 6:40 PM Alex Rousskov wrote:
> 
>     On 12/29/20 10:36 AM, roee klinger wrote:
> 
>     >     logfile_rotate 10
>     >     access_log daemon:/var/log/squid/access.log logformat=xxxx
>     rotate=10
> 
>     > running "squid -k rotate" still does nothing for the access.log file.
> 
>     Please note that, according to Squid documentation, your Squid is
>     slightly misconfigured:
> 
>     >       rotate=N                Specifies the number of log file
>     rotations to
>     >                               make when you run 'squid -k rotate'.
>     [...]
>     >                               Only supported by the stdio module.
> 
>     You are not using an "stdio" module. You are using a "daemon" module.
> 
>     This minor misconfiguraiton, if any, does not explain the lack of
>     rotations. The deamon module should still rotate based on your global
>     logfile_rotate directive setting.
> 
>     What is your Squid version? What logging and rotation-related messages
>     do you see in your cache.log (check both the pre-rotation and
>     post-rotation files)?
> 
>     Alex.
> 



More information about the squid-users mailing list