<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
  </configSections>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Security.Cryptography.Xml" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-8.0.0.2" newVersion="8.0.0.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.IO.RecyclableMemoryStream" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

  <log4net>
    <!-- Define some output appenders -->
    <appender name="rollingAppender" type="log4net.Appender.RollingFileAppender">
      <file value="${APP_DATA}"/>

      <!--追加日志内容-->
      <appendToFile value="true"/>

      <!--防止多线程时不能写Log,官方说线程非安全-->
      <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>

      <!--可以为:Once|Size|Date|Composite-->
      <!--Composite为Size和Date的组合-->
      <rollingStyle value="Composite"/>

      <!--当备份文件时,为文件名加的后缀,这里可以作为每一天的日志分别存储不同的文件-->
      <datePattern value="yyyy-MM-dd&quot;.txt&quot;"/>
      <StaticLogFileName value="false"/>

      <!--日志最大个数,都是最新的-->
      <!--rollingStyle节点为Size时,只能有value个日志-->
      <!--rollingStyle节点为Composite时,每天有value个日志-->
      <maxSizeRollBackups value="20"/>

      <!--可用的单位:KB|MB|GB-->
      <maximumFileSize value="5MB"/>

      <!--置为true,当前最新日志文件名永远为file节中的名字-->
      <staticLogFileName value="true"/>

      <!--输出级别在INFO和ERROR之间的日志-->
      <filter type="log4net.Filter.LevelRangeFilter">
        <param name="LevelMin" value="DEBUG"/>
        <param name="LevelMax" value="FATAL"/>
      </filter>

      <layout type="log4net.Layout.PatternLayout">
        <!--日志输出格式：时间  日志类型  日志内容-->
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
      </layout>
    </appender>

    <!-- levels: OFF > FATAL > ERROR > WARN > INFO > DEBUG  > ALL -->
    <root>
      <priority value="ALL"/>
      <level value="ALL"/>
      <appender-ref ref="rollingAppender"/>
    </root>
  </log4net>
</configuration>