Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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.

Ff650871.PI-INTRO-CommonScenario3(en-us,PandP.10).gif

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.

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.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.