How do I rotate access.log?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I rotate access.log?

Roeeklinger60
Hey,

I know there is plenty of information on this online but for some reason, this feature is simply not working for me. I have set logfile_rotate to 10 like so:
logfile_rotate 10

However, when I run "squid -k rotate" only the cache.log file rotates. I am using a custom log format and have also tried setting it like so according to the documentation:
logformat xxxx %ts.%03tu %6tr %>a %>lp %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
access_log daemon:/var/log/squid/access.log logformat=xxxx rotate=10

However, running "squid -k rotate" still does nothing for the access.log file.
I have also checked the proxy user has the proper permissions but it's still not working, any tips on what is going on and how to get this to work?

Best regards,
Roee Klinger

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Eliezer Croitoru-3
Hey Roee,

On what version of OS can it be tested, also is the package from the
distribution or self compiler?

Eliezer

On Tue, Dec 29, 2020 at 5:36 PM roee klinger <[hidden email]> wrote:

>
> Hey,
>
> I know there is plenty of information on this online but for some reason, this feature is simply not working for me. I have set logfile_rotate to 10 like so:
>
> logfile_rotate 10
>
>
> However, when I run "squid -k rotate" only the cache.log file rotates. I am using a custom log format and have also tried setting it like so according to the documentation:
>
> logformat xxxx %ts.%03tu %6tr %>a %>lp %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
> access_log daemon:/var/log/squid/access.log logformat=xxxx rotate=10
>
>
> However, running "squid -k rotate" still does nothing for the access.log file.
> I have also checked the proxy user has the proper permissions but it's still not working, any tips on what is going on and how to get this to work?
>
> Best regards,
> Roee Klinger
> _______________________________________________
> squid-users mailing list
> [hidden email]
> http://lists.squid-cache.org/listinfo/squid-users
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Alex Rousskov
In reply to this post by Roeeklinger60
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.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Roeeklinger60
Thanks for your reply,

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
2020/12/29 18:22:39 kid1| Logfile: opening log stdio:/var/spool/squid/netdb.state
2020/12/29 18:22:39 kid1| Logfile: closing log stdio:/var/spool/squid/netdb.state

Thanks.


On Tue, Dec 29, 2020 at 6:40 PM Alex Rousskov <[hidden email]> 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.

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Alex Rousskov
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.
>

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Roeeklinger60
Hey Alex, thanks for the reply.

This is my Squid --version:
Squid Cache: Version 4.6
Service Name: squid
Debian linux
configure options:  '--build=i686-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid' '--srcdir=.' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' 'BUILDCXXFLAGS=-g -O2 -fdebug-prefix-map=/build/squid-wx8Sif/squid-4.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -latomic' 'BUILDCXX=i686-linux-gnu-g++' '--with-build-environment=default' '--enable-build-info=Debian linux' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--libexecdir=/usr/lib/squid' '--mandir=/usr/share/man' '--enable-inline' '--disable-arch-native' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,SMB_LM' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,time_quota,unix_group,wbinfo_group' '--enable-security-cert-validators=fake' '--enable-storeid-rewrite-helpers=file' '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--with-gnutls' '--enable-linux-netfilter' 'build_alias=i686-linux-gnu' 'CC=i686-linux-gnu-gcc' 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/squid-wx8Sif/squid-4.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -latomic' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXX=i686-linux-gnu-g++' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/build/squid-wx8Sif/squid-4.6=. -fstack-protector-strong -Wformat -Werror=format-security

If I follow your instructions, this is what I get:
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

For "rotate" I am getting nothing, but I do however see transactions getting logged to access.log and my logging daemon is running properly.

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

Well, for cache.log I can that the file size is getting smaller and there are several cache.log.N files getting created, for access.log nothing is happening.

Any tips?


On Tue, Dec 29, 2020 at 8:37 PM Alex Rousskov <[hidden email]> wrote:
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.
>


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Alex Rousskov
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.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Roeeklinger60
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 <[hidden email]> 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.

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Eliezer Croitoru-3

Have you tried to use the OS logrotate?

 

----

Eliezer Croitoru

Tech Support

Mobile: +972-5-28704261

Email: [hidden email]

Zoom: Coming soon

 

 

From: squid-users <[hidden email]> On Behalf Of roee klinger
Sent: Sunday, January 10, 2021 5:25 PM
To: [hidden email]
Subject: Re: [squid-users] How do I rotate access.log?

 

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 <[hidden email]> 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.


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Matus UHLAR - fantomas
In reply to this post by Roeeklinger60
On 10.01.21 17:24, roee klinger wrote:
>I just wanted to give an update in case anyone is interested, I was not
>able to find a solution,

it was posted here:
http://lists.squid-cache.org/pipermail/squid-users/2020-December/023074.html

>> 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.

simply said, it could not work in your case,

>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.

isn't this the default in raspbian? Afaik it comes from debian, where this
is the default.


--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Support bacteria - they're the only culture some people have.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Amos Jeffries
Administrator
On 11/01/21 8:53 am, Matus UHLAR - fantomas wrote:

> On 10.01.21 17:24, roee klinger wrote:
>> I just wanted to give an update in case anyone is interested, I was not
>> able to find a solution,
>
> it was posted here:
> http://lists.squid-cache.org/pipermail/squid-users/2020-December/023074.html 
>
>
>>>     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.
>
> simply said, it could not work in your case,
>> 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.
>
> isn't this the default in raspbian? Afaik it comes from debian, where this
> is the default.
>

Exactly so. The Debian default is to offload log handling to logrotated.
Nothing needs to be done by the admin in squid.conf. Raspbian uses the
Debian package, rebuilt to run on the Pi hardware.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Roeeklinger60
Thanks, everyone for making it clear, I will investigate how to do it using logrotated.

Roee.

On Tue, Jan 12, 2021 at 3:26 AM Amos Jeffries <[hidden email]> wrote:
On 11/01/21 8:53 am, Matus UHLAR - fantomas wrote:
> On 10.01.21 17:24, roee klinger wrote:
>> I just wanted to give an update in case anyone is interested, I was not
>> able to find a solution,
>
> it was posted here:
> http://lists.squid-cache.org/pipermail/squid-users/2020-December/023074.html
>
>
>>>     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.
>
> simply said, it could not work in your case,
>> 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.
>
> isn't this the default in raspbian? Afaik it comes from debian, where this
> is the default.
>

Exactly so. The Debian default is to offload log handling to logrotated.
Nothing needs to be done by the admin in squid.conf. Raspbian uses the
Debian package, rebuilt to run on the Pi hardware.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: How do I rotate access.log?

Matus UHLAR - fantomas
On 12.01.21 15:09, roee klinger wrote:
>Thanks, everyone for making it clear, I will investigate how to do it using
>logrotated.

do you have squid installed from raspbian? squid 4.6 is in debian 10 thus
should be in raspbian too.

it comes with /etc/logrotate.d/squid and if you have logrotate package it
should care about rotating.


>On Tue, Jan 12, 2021 at 3:26 AM Amos Jeffries <[hidden email]> wrote:
>
>> On 11/01/21 8:53 am, Matus UHLAR - fantomas wrote:
>> > On 10.01.21 17:24, roee klinger wrote:
>> >> I just wanted to give an update in case anyone is interested, I was not
>> >> able to find a solution,
>> >
>> > it was posted here:
>> >
>> http://lists.squid-cache.org/pipermail/squid-users/2020-December/023074.html
>> >
>> >
>> >>>     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.
>> >
>> > simply said, it could not work in your case,
>> >> 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.
>> >
>> > isn't this the default in raspbian? Afaik it comes from debian, where
>> this
>> > is the default.


--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
   One OS to rule them all, One OS to find them,
One OS to bring them all and into darkness bind them
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users