How can I enable W3C extended log format on LAMP and where will the default log directory be located (and named what)? (or XAMPP)

1 Answer 1


You probably mean the W3C extended log format: http://www.w3.org/TR/WD-logfile.html.
Correcting your spelling and rephrasing your question may get you more answers.

This format is mostly used on Microsoft IIS servers. I'm not sure whether all required data is available in Apache and I couldn't find an example format string for you.

Simply put, you need to define the desired LogFormat in your Apache config, and then use the CustomLog option to specify where to write the logfile. Usually, depending on the settings, Apache writes its logs to /var/log/apache/, /var/log/apache2/ or /var/log/httpd/ but check your Apache config to find out.

Since the W3C extended format is free form, there is no single answer, but the NCSA extended log format, which is similar to the W3C format, looks like this:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" ncsa_extended
CustomLog /var/log/apache2/extended_access_log ncsa_extended

You can customize the parameters of LogFormat to get the info you want.

  • thank you! actually ironically, that was the original title of my post, i changed it today to shorten it, and now i get the first answer :) . actually all I'm looking for is the c-referrer and the full path requested, so I think I can figure it out from here - I did not no the option was unavailable outside of IIS (where obviously, I first met it and assumed it was universal)
    – nona urbiz
    Sep 7, 2009 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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