Logging with Quartz.net

后端 未结 1 806
迷失自我
迷失自我 2020-12-21 03:35

I will shamelessly state that I have little experience with Log4Net. I only just installed it, but it won\'t capture log events from Quartz.net, which is a scheduling librar

相关标签:
1条回答
  • 2020-12-21 04:25

    Try this configuration:

        <configSections>
          ....
          <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
          <section name="quartz" type="System.Configuration.NameValueSectionHandler, 
                   System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          <sectionGroup name="common">
            <section name="logging" type="Common.Logging.ConfigurationSectionHandler,
                     Common.Logging"/>
          </sectionGroup>
        </configSections>
    
        <appSettings>
          <add key="log4net.Internal.Debug" value="false"/>
        </appSettings>
    
        <common>
          <logging>
            <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
                            Common.Logging.Log4Net">
              <arg key="configType" value="INLINE"/>
              <arg key="configFile" value="Trace/application.log.txt"/>
              <arg key="level" value="ALL" />
            </factoryAdapter>
          </logging>
        </common>
    
        <log4net>
          <appender name="GeneralLog" type="log4net.Appender.RollingFileAppender">
            <file value="Trace/application.log.txt"/>
            <appendToFile value="true"/>
            <maximumFileSize value="1024KB"/>
            <rollingStyle value="Size"/>
            <layout type="log4net.Layout.PatternLayout">
              <conversionPattern value="%d{HH:mm:ss} [%t] %-5p %c - %m%n"/>
            </layout>
          </appender>
    
          <root>
            <level value="ALL"/>
            <appender-ref ref="GeneralLog"/>
          </root>
    
        </log4net>
    
    0 讨论(0)
提交回复
热议问题