Summary


This chapter covered the design of Enterprise Library's Logging and Instrumentation Application Block and how to configure and develop an application to use it. The description of the design of this block explained the purpose of each class that is involved in getting a log message from its sender to its final endpoints. This was broken down into two main areas: the client and the distributor.

The client side is responsible for the logging, ExtraInformationProviders, filtering, and distribution strategies. Formatters, Sinks, Categories, and Destinations were explained for the distributor. Examples showed how to leverage the extension points that exist for these elements. The chapter also included an analysis of the design for tracing in the Logging and Instrumentation Application Block and how it differs from pure logging.

The final section of this chapter represents the "how to" for the Logging and Instrumentation Application Block. If you only want to know how to log to a file or event log, this may be the only section that you will need to read. It showed how to configure the application block and how to write code to use it.

It is my hope that I have been able to convey that the Logging and Instrumentation Application Block is not difficult to use. It has been designed to abstract an application away from needing to know where LogEntries will be stored and how to get them there. The intent is to let you focus on simply logging a message at the proper point. Moreover, because the code for an application can be indifferent as to the Destination for its log messages, if the Destinations change, no code in the application needs to; only the application's configuration does.




Fenster Effective Use of Microsoft Enterprise Library(c) Building Blocks for Creating Enterprise Applications and Services 2006
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications and Services
ISBN: 0321334213
EAN: 2147483647
Year: 2004
Pages: 103
Authors: Len Fenster

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net