<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    探索與發現

    研究java技術

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      83 隨筆 :: 0 文章 :: 109 評論 :: 0 Trackbacks
    Enterprise Library 4.1 - October 2008
    Logging QuickStart

    The Logging QuickStart demonstrates the following scenarios:

    The QuickStart uses a top-level handler to catch any exceptions that occur during any of the scenarios. The handler displays a dialog box with the exception message.

    The QuickStart is provided in two versions. The first version uses the factory approach to create Enterprise Library objects and the static methods. For example, it uses the static Write method of the Logger class to write log messages and the static Tracer class to trace operations such as data access and write messages to a file.

    The second version demonstrates integration with the Unity Application Block. It creates and populates a UnityContainer instance with the data from the <unity> section of the configuration file. This loads the Enterprise Library Core and Logging Application Block extensions. This QuickStart also generates the main form instance using the Resolve method of the UnityContainer, which causes Unity to create and inject an instance of the LogWriter and non-static TraceManager classes in the form constructor. The QuickStart then uses the methods of these two instances to perform the tasks required. For example, it uses the Write method of the LogWriter class to write log messages and the StartTrace method of the non-static TraceManager class to trace operations such as data access and write messages to a file.

    For information about integration with the Unity Application Block, and how you can create instances of Enterprise Library objects using Unity, see Creating Objects Using the Unity Application Block.

    The QuickStart ships as source code, which means that you must compile it before running it. You use Visual Studio to build the QuickStart.

    To build the Logging QuickStart

    1. Ensure the Enterprise Library Source Code is installed.
    2. Open the Enterprise Library Source Code folder in Windows Explorer or from the Start menu. To open it from the Start menu, click Start on the taskbar, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 4.1October 2008, and then click Enterprise Library 4.1 Source Folder.
    3. To run the factory version of the QuickStart, open the QuickStarts folder, open the Logging folder, and then open the CS folder (for C#) or the VB folder (for Visual Basic .NET).
    4. To run the version of the QuickStart that demonstrates integration with the Unity Application Block, open the QuickStarts folder, open the Logging folder, and then open the CS - UnityIntegration folder (for C#) or the VB - UnityIntegration folder (for Visual Basic .NET).
    5. Double-click the LoggingQuickStart.sln icon.
    6. Visual Studio opens, displaying the solution file. On the Build menu, click Rebuild Solution. By default, this is a debug build.
    7. Press F5 to run the QuickStart.

    The default configuration for the Logging QuickStart has the following attributes:

    • General settings:
      • Tracing is enabled.
      • The default category is General.
    • Filters:
      • The category filter will allow all categories except UI Events.
      • The priority filter will only allow events with a priority value of 2 or higher
    • Categories:
      • Events in category Data Access Events are delivered to the Flat File Destination listener.
      • Events in category Debug are delivered to the Debug Destination listener.
      • Events in category General are delivered to the Event Log Destination listener.
      • Events in category Troubleshooting are delivered to the Event Log Destination listener.
      • Events in category UI Events are delivered to the Flat File Destination listener.
      • Events in category Trace are delivered to the Flat File Destination listener.
    • Special sources:
      • Events that occur due to an error are delivered to the Event Log Destination.
    • Listeners:
      • The Event Log Destination uses the Text Formatter to format the message and writes the result to the Application Event Log.
      • The Flat File Destination uses the Text Formatter to format the message and writes the result to the file named trace.log.
      • The Debug Destination uses the Text Formatter to format the message and writes the result to the Visual Studio Output Window.
    • Formatters:
      • The Text Formatter constructs a string with name value pairs for the LogEntry properties.

    The Logging QuickStart ships with a defined configuration, which is included in the App.config file. This file is located in the same folder as the QuickStart project file. Each time you build the code, Visual Studio copies the App.config file to the output directory for the project (the same directory where the QuickStart executable is created), and renames it to LoggingQuickStart.exe.config.

    To change or view these settings, use the Enterprise Library configuration tools to open the App.config file in the directory that contains the QuickStart project file. The App.config file contains the configuration data.

    You can also change the application configuration when you do not plan to recompile the application by opening the LoggingQuickStart.exe.config file with the Enterprise Library configuration tools. However, these changes will be overwritten during the next successful build.

    posted on 2009-02-11 07:20 蜘蛛 閱讀(1243) 評論(1)  編輯  收藏 所屬分類: 日常瑣事

    主站蜘蛛池模板: 国产又大又粗又硬又长免费 | 日本亚洲成高清一区二区三区| 亚洲性线免费观看视频成熟| 国产伦精品一区二区免费| 国产人成亚洲第一网站在线播放| 国产aⅴ无码专区亚洲av| 亚洲AV中文无码乱人伦| 最近最新MV在线观看免费高清| 日韩av无码免费播放| 又大又硬又粗又黄的视频免费看 | 国产h视频在线观看网站免费| 两个人看的www视频免费完整版| 国产成人亚洲精品无码AV大片| 国产成人精品日本亚洲网址| 亚洲色欲色欲综合网站| 国产亚洲综合成人91精品| 亚洲综合色在线观看亚洲| 免费的一级片网站| 久久这里只有精品国产免费10| 麻豆视频免费观看| 18女人腿打开无遮掩免费| 久草免费福利资源站| 叮咚影视在线观看免费完整版| 国产精品1024在线永久免费| 特级av毛片免费观看| 免费福利资源站在线视频| 另类图片亚洲校园小说区| 国产精品亚洲专区无码不卡| 色偷偷亚洲男人天堂| 亚洲成aⅴ人片久青草影院按摩| 亚洲人成人网毛片在线播放| 亚洲人成7777影视在线观看| 亚洲国产情侣一区二区三区| 亚洲日本国产乱码va在线观看| 久久亚洲AV无码精品色午夜麻豆| 亚洲av中文无码乱人伦在线播放| 亚洲成AV人片在| 亚洲AV天天做在线观看| 亚洲综合日韩中文字幕v在线| 亚洲综合无码一区二区| 亚洲免费视频在线观看|