2

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

user9517
  • 114,104
  • 20
  • 206
  • 289
nona urbiz
  • 187
  • 1
  • 1
  • 11

1 Answers1

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.

Martijn Heemels
  • 7,438
  • 6
  • 39
  • 62
  • 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 07 '09 at 22:39