You can enable trace logging for failed requests when you want to log information about failed requests to an IIS site or application. When trace logging for failed requests is enabled, IIS provides targeted logging so that you no longer have to look through a list of irrelevant log entries to find a failed request. Additionally, you do not have to re-create an error in order to troubleshoot it.
You can configure:
- The location of the log file
- The maximum number of log files to keep
- The maximum size of the log files
To enable site-level trace logging for failed requests
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.
To Use the UI
Open IIS Manager and navigate to the level you want to manage.
In the Connections pane, click Sites.
In Features View, select the site for which you want to enable trace logging.
In the Actions pane, under Configure, click Failed Request Tracing.
In the Edit Web Site Failed Request Tracing Settings dialog box, select Enable to enable logging for this site.
In the Directory text box, type the path where you want to store the log files or click the browse button (…) to find a location on the computer. The default is %SystemDrive%\inetpub\logs\FailedReqLogFiles.