Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where lies the config file to change the output of the access.log file? I want to remove the website the user was browsing and format the time so it's human readable.

share|improve this question
up vote 4 down vote accepted

You can define a custom log format in squid.conf with the logformat directive. This can then be used in the access_log directive:

logformat nourl  %tl %6tr %>a %Ss/%03>Hs %<st %[un %Sh/%<a %mt
access_log daemon:/usr/local/squid/var/logs/access.log nourl

will output a log file similar to the squid default, with time in local time and HTTP method and URL removed.

share|improve this answer
Awesome. Worked like a charm! The only thing that didn't work, was the last bit of logformat. "%<a %mt" should be a capital 'a'. And at first I didn't know that you have to set it up in /etc/squid3/squid.conf file. Thought it was kinda misleading to write "This can then be used within access_log". Should rather be "within squid.conf". Thanks though. – cherrun Feb 14 '12 at 13:12
Glad it worked, and sorry for confusion - I did link to the documentation so thought it might make it clear (although I see now that it's not clear that the directives don't look like hyperlinks). I've modified the answer for future reference. – James O'Gorman Feb 14 '12 at 13:33
Thanks for this, wanted to log the proxy username, and helped me too. It was %un btw – Aseques Nov 14 '12 at 9:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.