log4net.config 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <configuration>
  3. <log4net>
  4. <!-- 错误日志类-->
  5. <logger name="logerror">
  6. <level value="ALL" />
  7. <appender-ref ref="ErrorAppender" />
  8. </logger>
  9. <!-- 错误日志附加介质-->
  10. <appender name="ErrorAppender" type="log4net.Appender.RollingFileAppender">
  11. <!--日志文件路径-->
  12. <param name="File" value="log/" />
  13. <!--是否是向文件中追加日志-->
  14. <param name="AppendToFile" value="true" />
  15. <!--log保留天数-->
  16. <param name="MaxSizeRollBackups" value="1000" />
  17. <!--最大文件大小-->
  18. <param name="MaxFileSize" value="10240" />
  19. <!--日志文件名是否是固定不变的-->
  20. <param name="StaticLogFileName" value="false" />
  21. <!--日志文件名格式为:2008-08-31.log-->
  22. <param name="DatePattern" value="app-yyyy-MM-dd&quot;.log&quot;" />
  23. <!--日志根据日期滚动-->
  24. <param name="RollingStyle" value="Date" />
  25. <param name="Encoding" value="utf-8" />
  26. <!--信息日志布局-->
  27. <layout type="log4net.Layout.PatternLayout">
  28. <param name="ConversionPattern" value="&lt;!--异常信息头--&gt;%n【异常时间】:%d [%t] ;%n【异常级别】:%-5p %n%m %n &lt;!--异常信息尾部--&gt;%n" />
  29. </layout>
  30. </appender>
  31. <!-- 信息日志类 -->
  32. </log4net>
  33. <!-- To customize the asp.net core module uncomment and edit the following section.
  34. For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
  35. <!--
  36. <system.webServer>
  37. <handlers>
  38. <remove name="aspNetCore"/>
  39. <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
  40. </handlers>
  41. <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  42. </system.webServer>
  43. -->
  44. </configuration>