Re: [users@httpd] log file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

----- Original Message ----- 
From: "Montserrat Mateos" <mmateossa@xxxxxxx>
To: <users@xxxxxxxxxxxxxxxx>
Sent: Saturday, November 19, 2005 11:50 AM
Subject: [users@httpd] log file


> Hi, I want configure my access log file for apache and I want that the log
> file only save the client request (url) that he write in his navigator and
> not other url that the server send as images that the url has.

 The trick is to set an environment variable using SetEnvIf for the file
extensions you want and to append an env=VAR to your CustomLog directive.
The following example only logs requests for files with .htm(l) and .php
endings in NCSA Combined Log Format:

# Set Variable logrequest for HTML and PHP files:
SetEnvIf Request_URI "(\.html?)|(\.php)" logrequest
# Define Combined Log Format (usually predefined in httpd.conf):
LogFormat combined \
"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
# Log only if logrequest is set:
CustomLog logs/access_log combined env=logrequest

I would however recommend to leave the access_log file unchanged (logging
ALL requests in it) and define an additional log file for the HTML/PHP
things:

# Default access log file:
CustomLog logs/access_log combined
# Custom log file for HTML/PHP only
CustomLog logs/html_log combined env=logrequest

Hope that helps.

Regards
Sascha


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux