Thursday, September 18, 2008

Filter IIS logging

IIS uses a flexible and efficient logging architecture. When a loggable event, usually an HTTP transaction, occurs, IIS calls the selected logging module, which then writes to one of the logs stored in %SystemRoot%\system32\Logfiles\.

Ref: http://msdn.microsoft.com/en-us/library/ms525410.aspx

In case you want your IIS to NOT log specific web requests, then you can run this script:

CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs CREATE W3SVC/1/ROOT/proj1/WhosHere.aspx IIsWebFile
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs SET W3SVC/1/ROOT/proj1/WhosHere.aspx/DontLog 1

This should remove /proj1/WhosHere.aspx from ever being logged.

If you want IIS to log the page again, then you could replace the '1' with a '0' in the last line of the above script.

No comments:

About Us