<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>

  <log4net>  
	<!-- 调试日志类，发布时去除-->
	<logger name="logTest">
		<level value="ALL" />
		<appender-ref ref="TestAppender" />
		<appender-ref ref="ColoredConsoleAppender"/>
	</logger>
	<!-- 信息日志类 -->
	<logger name="logInfo">
		<level value="ALL" />
		<appender-ref ref="InfoAppender" />
		<appender-ref ref="ColoredConsoleAppender"/>
	</logger>
	<!-- 调试日志附加介质，发布时去除-->
	<appender name="TestAppender" type="log4net.Appender.RollingFileAppender">
		<param name="File" value="log\\" />
		<param name="AppendToFile" value="true" />
		<param name="MaxSizeRollBackups" value="10" />
		<param name="MaxFileSize" value="10240" />
		<param name="StaticLogFileName" value="false" />
		<param name="DatePattern" value="yyyyMMdd&quot;mfdriverex-test.log&quot;" />
		<param name="RollingStyle" value="Date" />
	<!--布局-->
	<layout type="log4net.Layout.PatternLayout">
	  <conversionPattern value="%d [%t] %-5p - %m%n" />
	</layout>
	</appender>
	<!-- 信息日志附加介质-->
	<appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
		<param name="File" value="log\\" />
		<param name="AppendToFile" value="true" />
		<param name="MaxFileSize" value="100" />
		<param name="MaxSizeRollBackups" value="10" />
		<param name="StaticLogFileName" value="false" />
		<param name="DatePattern" value="yyyyMMdd&quot;mfdriverex.log&quot;" />
		<param name="RollingStyle" value="Date" />
	<!-- 信息日志布局-->
	<layout type="log4net.Layout.PatternLayout">
	  <param name="ConversionPattern" value="%d [%t] %-5p - %m%n" />
	</layout>
	</appender>
  
    <!-- 控制台前台显示日志 -->
    <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
      <mapping>
        <level value="ERROR" />
        <foreColor value="Red, HighIntensity" />
      </mapping>
      <mapping>
        <level value="Info" />
        <foreColor value="Green" />
      </mapping>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%n%date{HH:mm:ss,fff} [%-5level] %m" />
      </layout>

      <filter type="log4net.Filter.LevelRangeFilter">
        <param name="LevelMin" value="Info" />
        <param name="LevelMax" value="Fatal" />
      </filter>
    </appender>
  </log4net>
</configuration>
