Logging Errors
If errors are intermittent or difficult to reproduce, then logging the
errors may be a good strategy for observing them.
Error logging with full details is enabled in the application's _Settings definition, as shown above, by setting the General element's debugging and logging attributes. Note the forward- and backward-slashes that differentiate a file path and a URL.
If the Error Log Location attribute value is left blank, the Debugger Trace Report will be written to the <application folder>\rdErrorLog folder, which will be created automatically.
If you only wish to log limited information, you can set the Debugger Style attribute to ErrorDetail or NoDetail. The log pages will then only include the level of detail provided by the corresponding error messages.
You can also redirect the error logging to a folder of your choice by providing an Error Log Location attribute value. This must be a fully-qualified folder path and you need to manually create the named folder if it does not already exist. Tokens can be used here as part of the path, such as:
@Function.AppPhysicalPath~\yourErrorLogFolder
Keep in mind that the account, which may be an application pool, used to run web applications requires full File Access rights to the target folder. If the folder does not exist, then the application folder must have these rights so that the target folder, when created, inherits them.
To use a custom location in a web farm environment, specify a network folder and change the application's identity to a network account.
For more information about identifying and debugging common Log4Net problems, see this article.