Enable or Disable Logging (IIS 7)
Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista
Enable logging for a server when you want IIS to selectively log only certain requests to a server based on configured criteria. As soon as server logging is enabled, you can enable selective logging for any site on the server. You can also then view the log file to see which requests are failing and which requests are succeeding.
Disable logging for a site when you no longer want IIS to log requests to a site selectively.
|By default, logging is enabled in IIS 7.|
For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Logging Feature Requirements (IIS 7).
Exceptions to feature requirements
You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
Open IIS Manager and navigate to the level you want to manage. For information about opening IIS Manager, see Open IIS Manager (IIS 7). For information about navigating to locations in the UI, see Navigation in IIS Manager (IIS 7).
In Features View, double-click Logging.
On the Logging page, in the Actions pane, click Enable to enable logging or click Disable to disable logging.
To enable logging, use the following syntax:
appcmd set config /section:httpLogging /dontLog:False
To disable logging, use the following syntax:
appcmd set config /section:httpLogging /dontLog:True
|When you use Appcmd.exe to configure the <httpLogging> element at the global level in IIS 7, you must specify /commit:WEBROOT in the command so that configuration changes are made to the root Web.config file instead of ApplicationHost.config.|
For more information about Appcmd.exe, see Appcmd.exe (IIS 7).