Share via


The Effects of the Logging Handler

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The policy declared for the example application injects the Logging Handler into the handler pipeline. No other code is required. The Logging Handler causes the application to generate Windows Event Log entries before and after each call to the GetCustomerList and GetCustomerName methods. Figure 1 illustrates one of the messages; it contains information about the method call, parameters, return value, call duration, and more.

Ff648729.7b558798-39bc-4ff7-a4eb-7decc6e342d8(en-us,PandP.10).png

Figure 1
The Windows Event Log entries created by the Logging Handler

At the same time, the Logging Handler updates an audit log file named Audit.log. This contains the same information as the event log entries. In a real-world scenario, your application would probably limit event log entries to errors of a specific priority or severity by using the filters and other configuration options available in the Logging Application Block.