log4net配置

<?xml version="1.0" encoding="UTF-8"?>
<log4net>
  <root>
    <level value="all" />
    <appender-ref ref="LogFileAppenderByDate" />
  </root>
  <appender name="LogFileAppenderByDate" type="log4net.Appender.RollingFileAppender" >
    <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
    <param name="AppendToFile" value="true" />
    <param name="Encoding" value="utf-8" />
    <param name="StaticLogFileName" value="true" />
    <param name="File" value="Log\\" />
    <param name="DatePattern" value="yyyyMM\\yyyy-MM-dd‘.txt‘" />
    <param name="StaticLogFileName" value="false" />
    <param name="RollingStyle" value="Composite" />
    <maxSizeRollBackups value="-1" />
    <maximumFileSize value="2MB" />
    <layout type="log4net.Layout.PatternLayout">
      <param name="ConversionPattern" value="%n-----%d-----line %L-----%level-----%c%n%m%n" />
    </layout>
  </appender>
</log4net>

 

log4net配置

上一篇:[Tips] Cleartext HTTP traffic to xxx not permitte


下一篇:常用js代码片段(一)