Datumsformat in squid Logfiles besser lesbar machen

Problem Die Uhrzeit des Seitenzugriffs kann man in menschenlesbarer Form loggen lassen. Ein Auszug aus der access.log von Squid sieht so aus: # 1262039778.063  223 192.168.1.8 TCP_MISS/302 789 GET http://www.google.com/ – DIRECT/74.125.79.104 text/html # Lösung Dazu die squid.conf anpassen: #logformat logformat lesbar %{%d.%m %H:%M:%S}tl %>a %Ss %ru #access_log /var/log/squid/access.log squid access_log /var/log/squid/access.log lesbar Das ergibt nun: 29.12 01:02:47  192.168.1.8 TCP_MISS http://www.google.de/ Links : http://www.squid-cache.org/Doc/config/logformat/ Alternativ kann die Unix Zeit 1262039778.063 mit diesem Konverter gelesen werden : http://www.onlineconversion.com/unix_time.htm  

Squid führt den logfile_rotate Befehl nicht aus

Problem Squid führt keine Rotation des Logs Lösung Damit squid -k rotate ausgeführt wird muss in squid.conf hinterlegt sein, wie viele Files Squid anlegen soll. Beispiel : logfile_rotate 100 generiert 100 Instanzen der Logfiles Schritt 1 : aus access.log wird access.log.0 Schritt 2 : aus access.log.0 wird access.log.1 aus access.log   wird access.log.0 usw. usf. Specifies the number of logfile rotations to make when you type ’squid -k rotate‘. The default is 10, which will rotate with extensions 0 through 9. Setting logfile_rotate to 0 will disable the file name rotation, but the logfiles are still closed and re-opened. This will enable you to rename the logfiles yourself just before sending the rotate signal. Note, the ’squid -k rotate‘ command normally …

weiterlesen ….