log4net.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <configSections>
  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
 </configSections>
 <log4net debug="false">
  
  <appender name="WebInfo_LogFileAppender" type="log4net.Appender.RollingFileAppender">
   <param name="File" value="log/log-" />
   <param name="AppendToFile" value="true" />
   <param name="RollingStyle" value="Date" />
   <param name="DatePattern" value="yyyyMMdd&quot;.txt&quot;" />
   <param name="StaticLogFileName" value="false" />
   <layout type="log4net.Layout.PatternLayout">
    <param name="ConversionPattern" value="%d [%t] %-5p %c [%method] - %L - %m%n" />
   </layout>
  </appender>
  
  <appender name="Exception_LogFileAppender" type="log4net.Appender.RollingFileAppender">
   <param name="File" value="log/Exception-" />
   <param name="AppendToFile" value="true" />
   <param name="RollingStyle" value="Date" />
   <param name="DatePattern" value="yyyyMMdd&quot;.txt&quot;" />
   <param name="StaticLogFileName" value="false" />
   <layout type="log4net.Layout.PatternLayout">
   <param name="ConversionPattern" value="%d [%t] %-5p %c [%method] - %L - %m%n" />
   </layout>
  </appender>
  
  <root>
   <level value="INFO" />
            <level value="ERROR" />
   <appender-ref ref="WebInfo_LogFileAppender" />
  </root>
  <logger name="exceptionInfo">
   <level value="INFO" />
            <level value="ERROR" />
   <appender-ref ref="Exception_LogFileAppender" />
  </logger>
 </log4net>
</configuration>

你可能感兴趣的:(config)