<?xml version="1.0" encoding="utf-8" ?>
<log4net>
  <!-- 错误日志（ERROR和FATAL） -->
  <appender name="ErrorFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="App_Data\logs\error.log" />
    <appendToFile value="true" />
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="10" />
    <maximumFileSize value="10MB" />
    <staticLogFileName value="true" />
    <threshold value="ERROR" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline%exception%newline" />
    </layout>
  </appender>

  <!-- 全量日志（INFO及以上） -->
  <appender name="AllFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="App_Data\logs\webapi.log" />
    <appendToFile value="true" />
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="10" />
    <maximumFileSize value="10MB" />
    <staticLogFileName value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date [%thread] %-5level %logger - %message%newline%exception%newline" />
    </layout>
  </appender>

  <root>
    <level value="INFO" />
    <appender-ref ref="AllFileAppender" />
    <appender-ref ref="ErrorFileAppender" />
  </root>
</log4net>
