Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
    
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 '09 at 22:39
add comment

Your Answer

 
discard

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.