[squid-users] How do I rotate access.log?
Alex Rousskov
rousskov at measurement-factory.com
Thu Dec 31 23:38:46 UTC 2020
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.
More information about the squid-users
mailing list