Linux – How to Add Date and Time to Squid Log

linuxloggingsquid

The standard squid log format writes time in seconds from epoch. How to add date and time in a human readable format?

Best Answer

Add these to squid.config file:

logformat timereadable %tl %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
access_log daemon:/var/log/squid/access.log timereadable 

then restart squid:

systemctl restart squid //for debian

Make sure the path were file is to be written exists.