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

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 閱讀(1131) 評論(0)  編輯 收藏 引用

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            猛男gaygay欧美视频| 免费成人av资源网| 国产精品国产三级国产aⅴ9色| 亚洲国产激情| 欧美激情一区二区三区在线视频观看 | 亚洲欧洲免费视频| 亚洲丁香婷深爱综合| 欧美成人自拍视频| 99精品国产99久久久久久福利| 亚洲美女视频| 国产日本欧洲亚洲| 欧美不卡视频一区发布| 欧美激情在线狂野欧美精品| 亚洲午夜极品| 久久电影一区| 亚洲三级色网| 亚洲综合日韩在线| 在线免费观看视频一区| 亚洲日韩欧美视频一区| 国产精品毛片在线| 免费亚洲一区| 欧美三区美女| 免费国产一区二区| 欧美三级在线| 久色成人在线| 欧美日韩亚洲在线| 久久久久久噜噜噜久久久精品| 欧美.日韩.国产.一区.二区| 亚洲一区二区三区影院| 久久精品日产第一区二区| 亚洲经典自拍| 销魂美女一区二区三区视频在线| 亚洲国产成人在线视频| 一区二区三区久久精品| 在线国产亚洲欧美| 亚洲一区二区三区影院| 最近中文字幕日韩精品| 欧美亚洲综合另类| 一区二区三区四区五区精品| 久久久久免费观看| 欧美亚洲综合另类| 欧美精品久久久久久久久老牛影院| 欧美在线观看你懂的| 欧美日韩八区| 欧美高清视频一区二区| 国产在线精品二区| 一本色道久久综合| aa国产精品| 免费av成人在线| 久久精品视频在线观看| 欧美视频一区二区三区四区| 亚洲高清自拍| 在线不卡a资源高清| 香蕉成人久久| 欧美主播一区二区三区| 欧美三级午夜理伦三级中文幕| 亚洲国产精品传媒在线观看 | 久久久青草婷婷精品综合日韩 | 在线播放日韩| 欧美在线观看你懂的| 欧美亚洲在线| 国产精品无码专区在线观看| 一区二区免费在线观看| 在线亚洲免费| 欧美日韩黄视频| 亚洲区中文字幕| 99视频一区二区| 欧美日韩国产欧| 亚洲精品网站在线播放gif| 亚洲精品你懂的| 欧美激情小视频| 亚洲精品乱码久久久久| 一本色道**综合亚洲精品蜜桃冫 | 欧美在线视频一区二区| 久久久久久精| 在线观看成人av电影| 麻豆精品91| 91久久在线播放| 亚洲色无码播放| 国产精品美女久久久| 亚洲欧美日本另类| 久久久精彩视频| 亚洲国产精品成人综合色在线婷婷| 久久综合狠狠| 亚洲精品1区2区| 亚洲欧美国产高清va在线播| 国产日韩欧美日韩| 久久久久久久波多野高潮日日| 免费观看久久久4p| 99精品免费网| 国产欧亚日韩视频| 美女露胸一区二区三区| 亚洲精品美女在线观看播放| 亚洲一区二区3| 国内综合精品午夜久久资源| 久久综合给合| 999亚洲国产精| 久久精品综合一区| 亚洲精品美女在线| 国产精品久久久久久久免费软件| 午夜影院日韩| 亚洲国产成人av| 欧美一区二区三区四区高清 | 国产在线欧美日韩| 免费成人小视频| 亚洲午夜激情网页| 女同性一区二区三区人了人一| av成人手机在线| 国产一区在线免费观看| 欧美高清视频www夜色资源网| 亚洲麻豆视频| 久久综合久久综合九色| 一区二区冒白浆视频| 国产精品久久网站| 老司机免费视频久久| 亚洲尤物在线| 亚洲国产精品传媒在线观看| 销魂美女一区二区三区视频在线| 亚洲人人精品| 国产最新精品精品你懂的| 欧美日韩在线免费视频| 噜噜噜噜噜久久久久久91| 亚洲欧美精品伊人久久| 亚洲乱码国产乱码精品精| 久久精品成人一区二区三区 | 国产精品久久久久三级| 欧美成人福利视频| 久久精品一区二区三区不卡牛牛| 在线一区日本视频| 亚洲国产女人aaa毛片在线| 久久久久久久久蜜桃| 小黄鸭视频精品导航| 中国日韩欧美久久久久久久久| 亚洲欧洲一区二区三区在线观看 | 欧美黑人多人双交| 久久乐国产精品| 欧美与黑人午夜性猛交久久久| 在线视频欧美一区| 99re6这里只有精品| 亚洲国产精品久久| 亚洲高清一二三区| 欧美高清自拍一区| 裸体一区二区三区| 免费观看30秒视频久久| 久久久91精品国产| 久久久久国产成人精品亚洲午夜| 香蕉久久夜色精品| 久久精品五月| 久久久久九九视频| 老牛嫩草一区二区三区日本| 久久精品久久综合| 久久性色av| 欧美福利专区| 最新热久久免费视频| 亚洲精品国产拍免费91在线| 日韩视频免费大全中文字幕| 日韩一级欧洲| 亚洲欧美一区二区三区极速播放 | 亚洲一级在线观看| 亚洲在线播放| 午夜精品国产| 久久久久久网址| 欧美成人首页| 欧美日韩在线不卡| 国产精品午夜在线观看| 黄色精品网站| 亚洲美洲欧洲综合国产一区| 正在播放亚洲一区| 久久不射网站| 亚洲第一中文字幕在线观看| 9色精品在线| 欧美亚洲系列| 欧美成熟视频| 国产精品视频免费观看www| 国产综合一区二区| 亚洲精品国产欧美| 午夜视频在线观看一区二区| 久久久久国产精品一区| 亚洲高清毛片| 亚洲欧美一区二区原创| 久久综合精品一区| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ入口 | 亚洲福利视频网站| 亚洲线精品一区二区三区八戒| 久久精品国产久精国产一老狼| 欧美黄色aa电影| 国产午夜精品久久| 一本色道久久综合一区| 久久在线视频| 这里只有视频精品| 噜噜噜91成人网| 国产情人综合久久777777| 亚洲三级影院| 久久一区二区三区四区五区| 99视频在线精品国自产拍免费观看| 久久黄色影院| 欧美mv日韩mv亚洲| 久久久久久国产精品mv| 欧美日韩大片一区二区三区| 欧美理论电影网|