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

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 閱讀(1134) 評論(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>
            亚洲国产精品精华液网站| 在线观看一区欧美| 亚洲激情成人| 99精品99久久久久久宅男| 99视频精品在线| 国产精品久久久久久久一区探花| 国产九九精品视频| 在线观看中文字幕亚洲| 欧美福利影院| 亚洲一区二区三区国产| 久久亚裔精品欧美| 欧美日韩一级片在线观看| 国产欧美日韩在线观看| 亚洲区中文字幕| 久久久久久久久久久久久久一区 | 国产乱码精品一区二区三区五月婷| 亚洲午夜电影网| 久久综合狠狠| 一区二区三区四区国产精品| 久久综合影音| 国产亚洲亚洲| 亚洲欧美三级在线| 欧美寡妇偷汉性猛交| 欧美激情一区二区在线| 在线电影国产精品| 久久精品中文字幕免费mv| 免费成人黄色片| 亚洲电影在线免费观看| 久久久久99精品国产片| 欧美精品福利在线| 欧美一级艳片视频免费观看| 一区二区三区欧美在线| 极品尤物一区二区三区| 久久精品国产清高在天天线 | 亚洲夫妻自拍| 久久成人精品视频| 国产一区在线免费观看| 欧美一区二区三区视频在线| 一区二区久久久久久| 影音先锋在线一区| 亚洲免费在线观看| 国产精品视频导航| 欧美一区2区三区4区公司二百| 免费在线观看成人av| 亚洲国产日韩一级| 亚洲日本成人网| 欧美日韩在线免费视频| 这里只有精品丝袜| 亚洲一区二区动漫| 一区二区三区国产在线| 麻豆9191精品国产| 久久尤物视频| 国产欧美日韩三级| 亚洲男人的天堂在线aⅴ视频| 99re在线精品| 在线亚洲成人| 一区精品久久| 久久精品99国产精品日本| 欧美亚洲一区三区| 国产精品高清在线观看| 久久久久久久久久看片| 国产精品亚洲综合| 小黄鸭精品密入口导航| 在线观看中文字幕不卡| 久久精品一区二区三区中文字幕| 亚洲日本免费电影| 99在线|亚洲一区二区| 日韩一区二区精品| 欧美日韩妖精视频| 一区二区国产精品| 亚洲免费视频在线观看| 久久久国产精品亚洲一区 | 欧美高清不卡| 亚洲人成网在线播放| 欧美黄色免费| 久久久久成人精品| 激情国产一区二区| 免费中文字幕日韩欧美| 亚洲国产综合在线看不卡| 亚洲日本中文字幕免费在线不卡| 欧美激情精品| 中日韩视频在线观看| 羞羞色国产精品| 激情亚洲网站| 欧美好骚综合网| 一区二区高清视频在线观看| 欧美一级专区免费大片| 伊人影院久久| 欧美另类女人| 欧美大片第1页| 在线视频一区二区| 国产午夜精品久久久久久久| 亚洲精品网站在线播放gif| 红桃视频成人| 亚洲欧美在线磁力| 亚洲影视综合| 欧美日本国产在线| 亚洲免费网站| 亚洲第一精品在线| 亚洲欧美日韩国产综合在线 | 欧美77777| 亚洲一区在线免费观看| 久久一区二区三区国产精品| aa日韩免费精品视频一| 久久午夜激情| 亚洲一区二区不卡免费| 欧美成人午夜免费视在线看片| 99精品99久久久久久宅男| 国产午夜精品久久久| 欧美国产日本| 久久久久综合一区二区三区| 久久九九久久九九| 99re6热只有精品免费观看 | 国产一区二区黄| 欧美久久久久中文字幕| 欧美在线高清视频| 久久国产精品久久久久久| 国产精品久久久久久久久久久久久久| 久久精品亚洲一区二区| 一本色道久久综合亚洲精品高清| 蜜臀va亚洲va欧美va天堂 | 欧美高清视频在线播放| 午夜视频一区在线观看| 99亚洲精品| 最新69国产成人精品视频免费| 久久久久在线| 精品69视频一区二区三区 | 久久理论片午夜琪琪电影网| 亚洲午夜激情在线| 久久精品国产亚洲精品| 亚洲一区视频在线| 一区二区三区国产在线观看| 91久久亚洲| 亚洲福利小视频| 影院欧美亚洲| 精品成人在线视频| 国产一区二区三区四区老人| 国产精品一区久久久久| 国产精品一区二区黑丝| 欧美亚洲成人网| 久久激情一区| 久久精品99久久香蕉国产色戒| 亚洲欧美清纯在线制服| 亚洲欧美国产一区二区三区| 亚洲视频免费在线观看| 亚洲一卡久久| 午夜一区二区三区不卡视频| 亚洲免费婷婷| 久久精品视频在线看| 久久人人爽人人| 可以看av的网站久久看| 美女黄毛**国产精品啪啪| 牛牛影视久久网| 欧美精品久久一区二区| 欧美久久九九| 国产精品毛片大码女人| 国产日韩欧美夫妻视频在线观看| 国产日韩专区在线| 在线精品在线| 99国内精品久久| 亚洲欧美一区二区原创| 久久久久久久999| 欧美电影专区| 一区二区三区欧美日韩| 午夜欧美大尺度福利影院在线看| 欧美在线一区二区| 女人色偷偷aa久久天堂| 欧美体内谢she精2性欧美| 国产欧美精品| 亚洲人屁股眼子交8| 亚洲欧美激情四射在线日 | 欧美高清不卡在线| 亚洲美女毛片| 欧美成人a∨高清免费观看| 午夜久久资源| 蜜桃久久av一区| 一本色道久久88亚洲综合88| 亚洲欧美成人精品| 免播放器亚洲一区| 国产精品v亚洲精品v日韩精品| 国产亚洲一本大道中文在线| 91久久在线视频| 欧美伊人久久| 亚洲三级视频在线观看| 西西人体一区二区| 欧美极品在线视频| 国产主播在线一区| 在线一区二区三区做爰视频网站| 久久九九免费视频| 99精品福利视频| 免费观看日韩av| 国产视频精品网| 亚洲性夜色噜噜噜7777| 欧美一区二区三区播放老司机| 亚洲成人中文| 亚洲高清不卡一区| 欧美亚洲在线播放| 欧美一区二区在线播放| 欧美日韩在线观看一区二区| 亚洲国产精品成人va在线观看|