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

roee klinger roeeklinger60 at gmail.com
Sun Jan 10 15:24:50 UTC 2021


Hey,

I just wanted to give an update in case anyone is interested, I was not
able to find a solution,
Instead, I set "logfile_rotate 0" and wrote my own custom script to rotate
the logs and I am running it as a cron, works just fine.

Thanks for trying to help.



On Fri, Jan 1, 2021 at 1:38 AM Alex Rousskov <
rousskov at measurement-factory.com> wrote:

> On 12/31/20 1:39 PM, roee klinger wrote:
>
> >     2020/12/31 20:33:49 kid1| Logfile: opening log
> daemon:/var/log/squid/access.log
> >     2020/12/31 20:33:49 kid1| Logfile Daemon: opening log
> /var/log/squid/access.log
> >     2020/12/31 20:33:49 kid1| Store logging disabled
> >     2020/12/31 20:33:57 kid1| logfileRotate:
> daemon:/var/log/squid/access.log
> >     2020/12/31 20:33:57 kid1| logfileRotate:
> daemon:/var/log/squid/access.log
> >     2020/12/31 20:33:57 kid1| Logfile: opening log
> daemon:/var/log/squid/access.log
> >     2020/12/31 20:33:57 kid1| Logfile Daemon: opening log
> /var/log/squid/access.log
> >     2020/12/31 20:33:57 kid1| Store logging disabled
>
> The second set of the "opening log" lines at 20:33:57 concern me -- why
> would somebody start opening those files when you are asking Squid to
> rotate the logs. However, this could be a red herring. Do you get the
> same kind of output when you send USR1 signal to the process identifier
> in the PID file (instead of running "squid -k rotate")?
>
>
> > Any tips?
>
> I have not looked at v4.6 code, but I do not see anything in the more
> recent code that would make the visible effects of access.log rotation
> conditional except setting logfile_rotate to zero. I also do not see any
> obviously relevant changes in v4 change.log (although there was one
> access-logging bug fixed).
>
> A few thing could go wrong. If you do not get better advice, I can
> suggest the following:
>
> * If you are a developer, I would recommend attaching a debugger to the
> logging daemon process to (a) make sure it gets the rotation command
> from Squid and (b) to understand why it ignores that command.
>
> * If you are a sysadmin, you may be able to attach strace to the logging
> daemon process and share its output. This is best done without user
> traffic going through Squid to avoid accidentally sharing user info.
> Here are rough steps:
>
> 1. Attach strace to the running daemon process (-p). Configure strace to
> log at least 100 bytes of system call data (-s 100). Tell strace to
> write the output into a file.
>
> 2. Rotate.
>
> 3. Wait a few seconds.
>
> 4. Stop strace. Compress and share a link to its output file.
>
>
> Cheers,
>
> Alex.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20210110/3ab004e8/attachment.htm>


More information about the squid-users mailing list