青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Javen-Studio 咖啡小屋

http://javenstudio.org - C++ Java 分布式 搜索引擎
Naven's Research Laboratory - Thinking of Life, Imagination of Future

  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
  24 隨筆 :: 57 文章 :: 170 評論 :: 4 Trackbacks
Enterprise Library 4.1 - October 2008
Design of the Logging Application Block

The Logging Application Block includes the following features:

  • A simple and consistent way of logging event information
  • Distribution of information to multiple sources
  • Activity tracing to mark the start and end of an activity such as a use case
  • Simplified application block configuration using the configuration tools
  • Extensibility through custom trace listeners and formatters

The Logging Application Block was designed to achieve the following goals:

  • Meet the performance requirements for the application block by ensuring that its code has minimal overhead compared to custom code that uses the System.Diagnostics namespace classes directly.
  • Take advantage of the capabilities provided by the .NET Framework System.Diagnostics namespace classes.
  • Make message routing flexible by using a simple model for distributing log entries.
  • Encapsulate the logic that performs the most common application logging tasks, minimizing the need for custom logging-related code.
  • Make sure that the application block is easily and highly configurable.
  • Make sure that the application block is extensible.

Figure 1 illustrates the design of the Logging Application Block.

Dd203220.cf9a3645-731c-45c0-9ed8-2862adfcd736(en-us,MSDN.10).png

Figure 1
Design of the Logging Application Block

The following sections describe the design of individual sections of the Logging Application Block:

Log Information

The LogEntry class encapsulates content and associated properties for the information an application sends to the application block for logging. Your client code creates new log entries and sets properties such as the message, title, priority, severity, and event ID. Other properties, such as the process name, process ID, and ThreadId, are populated by the application block. A LogEntry object also contains the ExtendedProperties property. This property is a collection of name/value pairs that allows you to place arbitrary string information into the LogEntry object. You can also create a custom LogEntry object by creating a class that derives from the LogEntry class.


Dd203220.note(en-us,MSDN.10).gifNote:
You must either create new formatters and trace listeners or modify the existing ones to support a custom LogEntry class that you create.


A LogEntry object has a collection of categories. The application block determines the destination for the log entry by its categories. You can also prevent the application from writing log entries that specify a designated category by using category filters.


Dd203220.note(en-us,MSDN.10).gifNote:
Client code can also pass information to the Logging Application Block without constructing a LogEntry object by using overloads of the Logger.Write method that do not require a LogEntry object. The application block will construct a LogEntry object for its internal use.

Logging Façade

The Logger class is a façade that sends a log entry to one or more destinations. The client code sends the information to the Logger instance, which then sends the LogEntry to an instance of the LogWriter class.

The LogWriter instance checks the filters to see if the LogEntry object should be discarded or sent to any of the trace sources. The filters are implementations of the ILogFilter interface. You specify the filter implementations in the configuration information. If the LogEntry object passes through the filters, the LogWriter instance sends it to each trace source identified by a name that matches one of the LogEntry object's categories.


Dd203220.note(en-us,MSDN.10).gifNote:
Whenever a Log Entry object fails within the LogWriter instance, the LogWriter instance writes a LogEntry object to the ErrorSource special trace source. The EventID is always the LogWriterFailureEventID. The EventID number is 6352.


The application block relies on the LogSource class to route LogEntry objects. The LogWriter instance has a collection of LogSource objects that correspond to the sources defined in the configuration file. The application block uses the collection of categories in a LogEntry object to determine the LogSource object to use for writing the LogEntry. Categories map directly to LogSource object names.

The LogWriter object also has three special LogSource objects. The AllEventsLogSource object receives all LogEntry objects. The NotProcessedLogSource object receives any LogEntry object that contains a category that does not have an associated LogSource object. The ErrorsLogSource object receives information about errors or warnings that occur while the Logging Application Block code is executing. It does not process errors or warnings from the application code.

Trace Listeners

Each trace source contains a (potentially empty) collection of trace listeners. A trace listener is a class that derives from the abstract class TraceListener in the System.Diagnostics namespace. Examples of trace listeners are the Windows Event Log, a text file, and Message Queuing. Although any TraceListener instance will work with the Logging Application Block, only those trace listeners that are provided with the Logging Application Block can format a LogEntry object. The trace listeners that the .NET Framework provides can be used by the Logging Application Block, but they only send strings.

The Logging Application Block trace listeners do not require a LogEntry object or a formatter to be instantiated. Instead, you can construct them by including the necessary information in the configuration file. The FormattedEventLogTraceListener, the FlatFileTraceListener, and the WmiTraceListener trace listeners use the same configuration information as the System.Diagnostics trace listeners. This means you can configure your application to use these three trace listeners in the <system.diagnostics> configuration section of your configuration file.

The MsmqTraceListener, FormattedDatabaseListener, and EmailTraceListener trace listeners require more configuration information. For example, the EmailTraceListener trace listener requires the destination e-mail address, the SMTP server name, and related e-mail information. You can configure your application to use these trace listeners by including the appropriate information in the configuration file. However, because these trace listeners require more information than the System.Diagnostics trace listeners, you cannot configure them in the <system.diagnostics> configuration section. Instead, you should use the <listeners> section located in the Logging Application Block configuration section. You can also construct these trace listeners in code and pass the required configuration information as parameters to their constructors.

The application block populates the collection of trace listeners from the application configuration data. The LogSource object sends the LogEntry object to each trace listener in the collection.

Log Filters

You can define configuration settings that control filtering of LogEntry objects. Filtering a LogEntry object prevents the application block from sending it to any trace source. The application block includes three types of filters. The CategoryFilter filters LogEntry objects by their category collection. The PriorityFilter filters LogEntry objects by their priority property. The LogEnabledFilter is a global filter that applies to all LogEntry objects in an application. With it, you can turn on and turn off logging. You can also create your own log filters. Use the configuration tools to add them to the application block's configuration information.

Log Formatters

Log entry information must often be formatted before it is written to the destination. Trace listeners that derive from the FormattedTraceListenerBase class format the log entry information before writing it to a destination. The application block includes two classes for formatting LogEntry information. (You can also build your own formatters.) The TextFormatter class converts the LogEntry into a text string. The contents of the string are determined by replacing tokens in the Template property of the TextFormatter configuration information in your application configuration file. The BinaryLogFormatter class uses the .NET Framework BinaryFormatter to serialize and deserialize the LogEntry in binary format. It should be used with the Message Queuing distributor service.

WCF Integration

The Logging Application Block includes three classes that, together, allow you to integrate it with applications that use WCF. These classes are the following:

  • XmlLogEntry
  • EntLibLoggingProxyTraceListener
  • XmlTraceListener

The XmlLogEntry class derives from the LogEntry class, but it includes an Xml property that allows it to contain the original XML data provided by WCF as well as the information that is contained in the LogEntry class.

The EntLibLoggingProxyTraceListener class is used in WCF’s System.ServiceModel trace source so that it can receive messages from WCF. It adds this information to an XmlLogEntry object and then sends the object to the Logging Application Block, which processes it.

The XmlTraceListener class derives from the .NET XmlWriterTraceListener class. It extracts XML data from an XmlLogEntry object and writes this data to an XML text file. You can analyze the output of this trace listener with the WCF log file analysis tools.

posted on 2008-12-26 17:20 Javen-Studio 閱讀(1116) 評論(0)  編輯 收藏 引用
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久影院亚洲| 午夜精品久久久久久99热| 玖玖视频精品| 亚洲国产中文字幕在线观看| 久久阴道视频| 欧美1区免费| 亚洲视频一区在线观看| 亚洲天堂av综合网| 国产亚洲综合精品| 麻豆国产精品777777在线| 美女在线一区二区| 在线亚洲激情| 欧美一区二区三区在线播放| 国户精品久久久久久久久久久不卡| 久久综合九色综合欧美就去吻| 美国成人直播| 亚洲欧美一区二区视频| 久久精品国产999大香线蕉| 亚洲国产精品嫩草影院| 亚洲精品少妇| 国产无一区二区| 亚洲国产精品一区二区www在线| 一区二区免费在线视频| 99re热这里只有精品视频| 国产视频久久久久| 亚洲国产成人久久综合| 国产精品久久二区二区| 欧美成人国产| 国产欧美日本| 亚洲国产精品久久| 国产亚洲a∨片在线观看| 亚洲激情视频在线| 国产一区免费视频| 国产色婷婷国产综合在线理论片a| 黄色日韩在线| 亚洲小说欧美另类婷婷| 亚洲国产欧美精品| 亚洲欧美日韩一区二区在线| 亚洲二区在线| 久久国产福利国产秒拍| 亚洲图片你懂的| 欧美**人妖| 久久久久久久波多野高潮日日 | 亚洲综合色自拍一区| 久久深夜福利免费观看| 亚洲欧美中文日韩在线| 嫩草影视亚洲| 免费不卡在线观看| 国产欧美日韩一区二区三区在线 | 久久精品国产综合| 国产精品福利片| 亚洲美女中出| 日韩视频免费观看| 免费成人美女女| 欧美成人a∨高清免费观看| 国产伪娘ts一区| 亚洲欧美日韩国产一区二区| 亚洲性人人天天夜夜摸| 欧美日韩在线播放三区| 亚洲人成在线播放网站岛国| 亚洲国产mv| 欧美www在线| 欧美大片一区二区| 亚洲国产福利在线| 久久一区中文字幕| 欧美大片va欧美在线播放| 在线欧美亚洲| 你懂的视频一区二区| 欧美激情1区2区3区| 亚洲国产成人不卡| 免费在线成人av| 亚洲欧洲日本国产| 久久激情五月婷婷| 久色婷婷小香蕉久久| 激情欧美一区二区三区在线观看| 欧美亚洲一区| 欧美激情久久久久久| 日韩亚洲在线观看| 欧美少妇一区二区| 亚洲综合成人在线| 欧美一区二区黄色| 影院欧美亚洲| 欧美国产精品| 亚洲色诱最新| 久久国产色av| 亚洲经典自拍| 国产精品99免费看 | 国产一二三精品| 久久久亚洲成人| 亚洲国产精品成人一区二区| 一本色道久久99精品综合| 欧美午夜视频在线观看| 欧美一区二区三区四区在线观看 | 一区二区91| 国产精品永久免费| 一区二区三区欧美| 久久久久久亚洲精品不卡4k岛国| 一区二区三欧美| 狠狠爱www人成狠狠爱综合网| 老司机凹凸av亚洲导航| 日韩视频二区| 老**午夜毛片一区二区三区| 亚洲精品日韩激情在线电影| 国产精品久久看| 蜜臀av在线播放一区二区三区| 亚洲理伦电影| 免费一级欧美片在线观看| 亚洲午夜国产成人av电影男同| 国产日韩一区二区三区| 欧美成人免费一级人片100| 亚洲欧美国产77777| 欧美大学生性色视频| 亚洲女人天堂成人av在线| 亚洲国产精品一区二区第四页av| 欧美男人的天堂| 久久综合给合久久狠狠色| 亚洲午夜在线视频| 亚洲第一网站免费视频| 久久久久久网址| 欧美一区二区三区在线| 亚洲精品综合| 亚洲高清资源综合久久精品| 国产精品视频免费在线观看| 欧美精品一区在线观看| 老鸭窝亚洲一区二区三区| 亚洲欧美国产日韩天堂区| 日韩一本二本av| 亚洲高清av在线| 女仆av观看一区| 久久午夜精品一区二区| 欧美一级电影久久| 亚洲欧美成人一区二区三区| 亚洲精品久久嫩草网站秘色 | 国产精品视频福利| 欧美香蕉视频| 欧美三级黄美女| 欧美欧美在线| 欧美高清视频| 欧美成人久久| 欧美电影免费观看高清| 久久综合色8888| 久久在线观看视频| 亚洲综合三区| 在线一区二区日韩| 国产精品99久久久久久久女警 | 美女诱惑一区| 看片网站欧美日韩| 美女尤物久久精品| 欧美黄色一级视频| 亚洲精品1234| 亚洲麻豆国产自偷在线| 日韩亚洲欧美高清| 亚洲一卡二卡三卡四卡五卡| 亚洲视频在线免费观看| 香蕉国产精品偷在线观看不卡 | 亚洲人成在线观看| 在线亚洲成人| 欧美一区二区三区视频在线| 久久精品国产77777蜜臀| 久久久一区二区| 欧美精品一区二区三区一线天视频| 欧美成人午夜| 国产精品黄色| 国产一区二区无遮挡| 亚洲激情一区二区三区| 一本久道久久久| 欧美在线视频在线播放完整版免费观看| 久久国产欧美日韩精品| 久久在线免费观看| 亚洲韩国青草视频| 亚洲少妇自拍| 久久综合久久久久88| 欧美日韩国产在线| 国产一区二区三区最好精华液| 亚洲国产精品第一区二区三区 | 伊人成人在线视频| 亚洲精品黄网在线观看| 亚洲在线视频| 暖暖成人免费视频| 一区二区三区福利| 久久久噜噜噜久久狠狠50岁| 欧美精品二区| 国产亚洲欧美一区二区| 亚洲精品免费看| 欧美综合二区| 亚洲美女在线一区| 久久成人在线| 国产精品久久久久久久久 | 毛片基地黄久久久久久天堂| 国产精品mm| 日韩视频中文字幕| 久久色在线播放| 亚洲一二三四区| 欧美成人在线免费观看| 国产欧美欧洲在线观看| 中文欧美字幕免费| 欧美黄色aa电影| 久久久精品一区二区三区| 国产精品videosex极品| 最近看过的日韩成人|