Update documentation about logrotate configuration. Thanks to Gill Bates for the report.

This commit is contained in:
Gilles Darold 2020-11-06 07:02:02 +01:00
parent 1cdee5fed1
commit 2b8a4f3c66
2 changed files with 46 additions and 24 deletions

35
README
View File

@ -127,21 +127,32 @@ INSTALLATION
If your squid logfiles are rotated then cron isn't going to give the
expected result as there exists a time between when the cron is run and
the logfiles are rotated. It would be better to call squid-analyzer from
logrotate, eg:
logrotate, create file /etc/logrotate.d/squid with the following
content:
/var/log/proxy/squid-access.log {
daily
compress
rotate 730
missingok
nocreate
sharedscripts
postrotate
test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
/usr/bin/squid-analyzer -d -l /var/log/proxy/squid-access.log.1
endscript
/var/log/squid/*.log {
daily
compress
delaycompress
rotate 5
missingok
nocreate
sharedscripts
postrotate
test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate
/usr/local/bin/squid-analyzer -d -l /var/log/squid/access.log.1
endscript
}
Be sure that the paths used in this script correspond to your system.
5. Adjust the configuration
Make sure that the LogFile path is correct in your squidanalyzer.conf
file. For instance:
LogFile /var/log/squid/access.log
You can also use network name instead of network ip addresses by using
the network-aliases file. Also if you don't have authentication enable
and want to replace client ip addresses by some know user or computer

View File

@ -130,21 +130,32 @@ or run it manually. For more information, see README file.
If your squid logfiles are rotated then cron isn't going to give the expected
result as there exists a time between when the cron is run and the logfiles
are rotated. It would be better to call squid-analyzer from logrotate, eg:
are rotated. It would be better to call squid-analyzer from logrotate, create
file /etc/logrotate.d/squid with the following content:
/var/log/proxy/squid-access.log {
daily
compress
rotate 730
missingok
nocreate
sharedscripts
postrotate
test ! -e /var/run/squid.pid || /usr/sbin/squid -k rotate
/usr/bin/squid-analyzer -d -l /var/log/proxy/squid-access.log.1
endscript
/var/log/squid/*.log {
daily
compress
delaycompress
rotate 5
missingok
nocreate
sharedscripts
postrotate
test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate
/usr/local/bin/squid-analyzer -d -l /var/log/squid/access.log.1
endscript
}
Be sure that the paths used in this script correspond to your system.
5. Adjust the configuration
Make sure that the LogFile path is correct in your squidanalyzer.conf file.
For instance:
LogFile /var/log/squid/access.log
You can also use network name instead of network ip addresses by using the
network-aliases file. Also if you don't have authentication enable and
want to replace client ip addresses by some know user or computer you