博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

<configSections>
  <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  <!--log4net config section-->
  <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>

    <!--<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>-->
   
 </configSections>
 
 <!--Enterprise Library 4.1 Logging Config Info. We Can Use Editer to Config it! -->
 <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
  <listeners>
   <add fileName="E:\HSCIS_log\Exception.log" footer="====================footer====================" formatter="Text Exception Trace Formatter" header="====================header==================== " rollFileExistsBehavior="Increment" rollInterval="Day" rollSizeKB="2048" timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Rolling Flat File Exception Trace Listener"/>
   <add fileName="E:\HSCIS_log\InformationLog.log" footer="====================footer====================" formatter="Text Information Log Formatter" header="====================header====================" rollFileExistsBehavior="Increment" rollInterval="Day" rollSizeKB="2048" timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" traceOutputOptions="None" filter="Information" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Rolling Flat File Information Trace Listener"/>
  </listeners>
  <formatters>
   <add template="Timestamp: {timestamp}&#xA;Message: {message}&#xA;Category: {category}&#xA;Priority: {priority}&#xA;EventId: {eventid}&#xA;Severity: {severity}&#xA;Title:{title}&#xA;Machine: {machine}&#xA;Application Domain: {appDomain}&#xA;Process Id: {processId}&#xA;Process Name: {processName}&#xA;Win32 Thread Id: {win32ThreadId}&#xA;Thread Name: {threadName}&#xA;Extended Properties: {dictionary({key} - {value}&#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Text Exception Trace Formatter"/>
   <add template="Timestamp: {timestamp}&#xA;Message: {message}&#xA;Category: {category}&#xA;Priority: {priority}&#xA;EventId: {eventid}&#xA;Severity: {severity}&#xA;Title:{title}&#xA;Machine: {machine}&#xA;Application Domain: {appDomain}&#xA;Process Id: {processId}&#xA;Process Name: {processName}&#xA;Win32 Thread Id: {win32ThreadId}&#xA;Thread Name: {threadName}&#xA;Extended Properties: {dictionary({key} - {value}&#xA;)}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Text Information Log Formatter"/>
  </formatters>
  <logFilters>
   <add enabled="true" type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.LogEnabledFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="LogEnabled Filter"/>
  </logFilters>
  <categorySources>
   <add switchValue="All" name="General">
    <listeners>
     <add name="Rolling Flat File Information Trace Listener"/>
    </listeners>
   </add>
   <add switchValue="All" name="Trace">
    <listeners>
     <add name="Rolling Flat File Exception Trace Listener"/>
    </listeners>
   </add>
  </categorySources>
  <specialSources>
   <allEvents switchValue="All" name="All Events"/>
   <notProcessed switchValue="All" name="Unprocessed Category"/>
   <errors switchValue="All" name="Logging Errors &amp; Warnings">
    <listeners>
     <add name="Rolling Flat File Exception Trace Listener"/>
     <add name="Rolling Flat File Information Trace Listener"/>
    </listeners>
   </errors>
  </specialSources>
 </loggingConfiguration>
 
 <!--Log4Net Config Info-->
 <log4net>
  <!--RollingFileAppender 使用Rolling方式記錄日誌 每個日誌檔最大100KB,
  生成的日誌檔案名會是log.txt.1,log.txt.2 ...log.txt.10
  如果記錄的日誌超過10個,會從log.txt.1開始覆蓋-->
  <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
   <!--定義檔存放位置-->
   <file value="D:\HSCIS_log\RollingFileAppender_log.txt"/>
   <appendToFile value="true"/>
   <rollingStyle value="Size"/>
   <maxSizeRollBackups value="10"/>
   <maximumFileSize value="100KB"/>
   <staticLogFileName value="true"/>
   <!--輸出格式-->
   <!--樣例:2008-03-26 13:42:32,111 [10] INFO  Log4NetDemo.MainClass [(null)] - info-->
   <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="記錄時間:%date 線程ID:[%thread] 日誌級別:%-5level 出錯類:%logger property:[%property{NDC}] - 錯誤描述:%message %newline"/>
   </layout>
  </appender>
  <!--RollingLogFileAppender_DateFormat 使用Rolling方式記錄日誌,按照日來記錄日誌-->
  <appender name="RollingLogFileAppender_DateFormat" type="log4net.Appender.RollingFileAppender">
   <file value="D:\HSCIS_log\RollingLogFileAppender_DateFormat_log.txt"/>
   <appendToFile value="true"/>
   <rollingStyle value="Date"/>
   <!--<datePattern value="yyyyMMdd-HHmm" />-->
   <datePattern value="yyyyMMdd"/>
   <layout type="log4net.Layout.PatternLayout">
    <!--<conversionPattern value="%date [%thread](%file:%line) %-5level %logger [%property{NDC}] - %message%newline" />-->
    <conversionPattern value="記錄時間:%date 線程ID:[%thread] 日誌級別:%-5level 出錯類:%logger property:[%property{NDC}] - 錯誤描述:%message %newline"/>
   </layout>
  </appender>
  <!--定義日誌的輸出媒介,下面定義日誌以四種方式輸出。也可以下面的按照一種類型或其他類型輸出。-->
  <root>
   <!--RollingFileAppender 循環記錄日誌-->
   <appender-ref ref="RollingFileAppender"/>
   <!--RollingFileAppender 以日期 循環記錄日誌-->
   <appender-ref ref="RollingLogFileAppender_DateFormat"/>
   <!--控制台控制顯示日誌-->
   <!--<appender-ref ref="ConsoleAppender" />-->
   <!--Windows事件日誌-->
   <!--<appender-ref ref="EventLogAppender" />-->
   <!-- 如果不啟用相應的日誌記錄,可以通過這種方式注釋掉
   <appender-ref ref="AdoNetAppender_Access" />
   -->
  </root>
 </log4net>

  <!--Enterprise Library 4.1 Caching Config Info. We Can Use Editer to Config it!-->
  <cachingConfiguration defaultCacheManager="Cache Manager">
    <cacheManagers>
      <add expirationPollFrequencyInSeconds="1800" maximumElementsInCacheBeforeScavenging="1000"
        numberToRemoveWhenScavenging="10" backingStoreName="Null Storage"
        type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Cache Manager" />
    </cacheManagers>
    <backingStores>
      <add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Null Storage" />
    </backingStores>
  </cachingConfiguration>