<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net-net-2.0"/>
  </configSections>
  <log4net>
    <root>
      <appender-ref ref="ErrorLogFileAppender"/>
      <appender-ref ref="DebugLogFileAppender"/>
	  <appender-ref ref="WarningFileAppender"/>
      <appender-ref ref="LogFileAppender"/>
      
    </root>
    <!--记录warning-->
    <appender name="WarningFileAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="log\\" />
      <param name="AppendToFile" value="true" />
      <param name="RollingStyle" value="Date" />
      <param name="DatePattern" value="&quot;&quot;yyyyMMdd&quot;_Warning.txt&quot;" />
      <param name="StaticLogFileName" value="false" />
      <layout type="log4net.Layout.PatternLayout,log4net">
        <conversionPattern value="%date  [%-5level] %message%newline"/>
      </layout>
      <filter type="log4net.Filter.LevelRangeFilter">
        <param name="LevelMin" value="WARN"/>
        <param name="LevelMax" value="WARN"/>
      </filter>
    </appender>
    
    <!--记录错误-->
    <appender name="ErrorLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="log\\" />
      <param name="AppendToFile" value="true" />
      <param name="RollingStyle" value="Date" />
      <param name="DatePattern" value="&quot;&quot;yyyyMMdd&quot;_Error.txt&quot;" />
      <param name="StaticLogFileName" value="false" />
      <layout type="log4net.Layout.PatternLayout,log4net">
        <conversionPattern value="%date  [%-5level] %message%newline"/>
      </layout>
      <filter type="log4net.Filter.LevelRangeFilter">
        <param name="LevelMin" value="ERROR"/>
        <param name="LevelMax" value="ERROR"/>
      </filter>
    </appender>
    
    <!--记录调试日志-->
    <appender name="DebugLogFileAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="log\\" />
      <param name="AppendToFile" value="true" />
      <param name="RollingStyle" value="Date" />
      <param name="DatePattern" value="&quot;&quot;yyyyMMdd&quot;_Debug.txt&quot;" />
      <param name="StaticLogFileName" value="false" />
      <layout type="log4net.Layout.PatternLayout,log4net">
        <conversionPattern value="%date  [%-5level] %message%newline"/>
      </layout>
      <filter type="log4net.Filter.LevelRangeFilter">
        <param name="LevelMin" value="DEBUG"/>
        <param name="LevelMax" value="DEBUG"/>
      </filter>
    </appender>
    
    <!--普通日志-->
    <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
    	<param name="File" value="log\\" />
      <param name="AppendToFile" value="true" />
      <param name="RollingStyle" value="Composite" /><!--按照何种方式产生多个日志文件(日期[Date],文件大小[Size],混合[Composite])-->
      <param name="MaxSizeRollBackups" value="10" /><!--最多产生的日志文件数，超过则只保留最新的n个。设定值value="－1"为不限文件数-->
      <param name="maximumFileSize" value="10MB" /><!--每个文件的大小。只在混合方式与文件大小方式下使用。超出大小后在所有文件名后自动增加正整数重新命名，数字最大的最早写入。可用的单位:KB|MB|GB。不要使用小数,否则会一直写入当前日志-->
      <param name="DatePattern" value="&quot;&quot;yyyyMMdd&quot;.txt&quot;" />
      <param name="StaticLogFileName" value="false" />
      <layout type="log4net.Layout.PatternLayout,log4net">
        <conversionPattern value="%date  [%-5level] %message%newline"/>
      </layout>
    </appender>

  </log4net>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>