<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
  </configSections>
  <appSettings>
  </appSettings>
  <log4net>
    <!--错误日志类-->
    <logger name="logerror">
      <level value="ALL" />
      <appender-ref ref="ErrorAppender" />
      <appender-ref ref="ColoredConsoleAppender" />
    </logger>

    <!--信息日志类-->
    <logger name="loginfo">
      <level value="ALL" />
      <appender-ref ref="InfoAppender" />
      <appender-ref ref="ColoredConsoleAppender" />
    </logger>

    <!--PLC日志类-->
    <logger name="plclog">
      <level value="ALL" />
      <appender-ref ref="PlcAppender" />
      <!--<appender-ref ref="ColoredConsoleAppender" />-->
    </logger>

    <!--RFID日志类-->
    <logger name="rfidlog">
      <level value="ALL" />
      <appender-ref ref="RfidAppender" />
      <appender-ref ref="ColoredConsoleAppender" />
    </logger>

    <!--RFID日志类-->
    <logger name="viewlog">
      <level value="ALL" />
      <appender-ref ref="ViewAppender" />
      <!--<appender-ref ref="ColoredConsoleAppender" />-->
    </logger>

    <!--Sql日志类-->
    <logger name="sqllog">
      <level value="ALL" />
      <appender-ref ref="SqlAppender" />
      <!--<appender-ref ref="ColoredConsoleAppender" />-->
    </logger>

    <!--信号量日志类-->
    <logger name="semaphorelog">
      <level value="ALL" />
      <appender-ref ref="SemaphoreAppender" />
      <!--<appender-ref ref="ColoredConsoleAppender" />-->
    </logger>


    <!-- 将日志输出到控制台 -->
    <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">

      <mapping>
        <level value="ERROR" />
        <foreColor value="Red, HighIntensity" />
      </mapping>
      <mapping>
        <level value="Info" />
        <foreColor value="White" />
      </mapping>
      <mapping>
        <level value="Debug" />
        <foreColor value="Yellow, HighIntensity" />
      </mapping>

      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
      </layout>
    </appender>

    <!--错误日志附加介质-->
    <appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="Log\" />
      <param name="AppendToFile" value="true" />
      <param name="MaxSizeRollBackups" value="100" />
      <param name="MaxFileSize" value="10240" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value='yyyy-MM-dd/"LogError.html"'/>
      <param name="RollingStyle" value="Date" />
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="&lt;HR COLOR=red&gt;%n异常时间：%d [%t] &lt;BR&gt;%n异常级别：%-5p &lt;BR&gt;%n异 常 类：%c [%x] &lt;BR&gt;%n%m &lt;BR&gt;%n &lt;HR Size=1&gt;"  />
      </layout>
    </appender>

    <!--信息日志附加介质-->
    <appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="Log\" />
      <param name="AppendToFile" value="true" />
      <param name="MaxFileSize" value="10240" />
      <param name="MaxSizeRollBackups" value="100" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value='yyyy-MM-dd/"LogInfo.txt"' />
      <param name="RollingStyle" value="Date" />
      <!--信息日志布局-->
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间：%d [%t] %n日志级别：%-5p %n日志内容：%m %n "  />
      </layout>
    </appender>

    <!--PLC日志附加介质-->
    <appender name="PlcAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="Log\" />
      <param name="AppendToFile" value="true" />
      <param name="MaxFileSize" value="10240" />
      <param name="MaxSizeRollBackups" value="100" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value='yyyy-MM-dd/"PlcLog.txt"' />
      <param name="RollingStyle" value="Date" />
      <!--信息日志布局-->
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间：%d [%t] %n日志级别：%-5p %n日志内容：%m %n "  />
      </layout>
    </appender>

    <!--Rfid日志附加介质-->
    <appender name="RfidAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="Log\" />
      <param name="AppendToFile" value="true" />
      <param name="MaxFileSize" value="10240" />
      <param name="MaxSizeRollBackups" value="100" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value='yyyy-MM-dd/"RfidLog.txt"' />
      <param name="RollingStyle" value="Date" />
      <!--信息日志布局-->
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间：%d [%t] %n日志级别：%-5p %n日志内容：%m %n "  />
      </layout>
    </appender>

    <appender name="ViewAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="Log\" />
      <param name="AppendToFile" value="true" />
      <param name="MaxFileSize" value="10240" />
      <param name="MaxSizeRollBackups" value="100" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value='yyyy-MM-dd/"ViewLog.txt"' />
      <param name="RollingStyle" value="Date" />
      <!--信息日志布局-->
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间：%d [%t] %n日志级别：%-5p %n日志内容：%m %n "  />
      </layout>
    </appender>

    <appender name="SqlAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="Log\" />
      <param name="AppendToFile" value="true" />
      <param name="MaxFileSize" value="10240" />
      <param name="MaxSizeRollBackups" value="100" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value='yyyy-MM-dd/"SqlLog.txt"' />
      <param name="RollingStyle" value="Date" />
      <!--信息日志布局-->
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间：%d [%t] %n日志级别：%-5p %n日志内容：%m %n "  />
      </layout>
    </appender>

    <appender name="SemaphoreAppender" type="log4net.Appender.RollingFileAppender">
      <param name="File" value="Log\" />
      <param name="AppendToFile" value="true" />
      <param name="MaxFileSize" value="10240" />
      <param name="MaxSizeRollBackups" value="100" />
      <param name="StaticLogFileName" value="false" />
      <param name="DatePattern" value='yyyy-MM-dd/"SemaphoreLog.txt"' />
      <param name="RollingStyle" value="Date" />
      <!--信息日志布局-->
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="&lt;--------------&gt;%n日志时间：%d [%t] %n日志级别：%-5p %n日志内容：%m %n "  />
      </layout>
    </appender>

  </log4net>
</configuration>