log4net.config 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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\\LogError\\" />
  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="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. <logger name="loginfo">
  33. <level value="ALL" />
  34. <appender-ref ref="InfoAppender" />
  35. </logger>
  36. <!-- 信息日志附加介质-->
  37. <appender name="InfoAppender" type="log4net.Appender.RollingFileAppender">
  38. <!--日志文件路径-->
  39. <param name="File" value="Log\\LogInfo\\" />
  40. <!--是否是向文件中追加日志-->
  41. <param name="AppendToFile" value="true" />
  42. <!--log保留天数-->
  43. <param name="MaxSizeRollBackups" value="100" />
  44. <param name="MaxFileSize" value="1" />
  45. <!--日志文件名是否是固定不变的-->
  46. <param name="StaticLogFileName" value="false" />
  47. <!--日志文件名格式为:2008-08-31.log-->
  48. <param name="DatePattern" value="yyyy-MM-dd&quot;.log&quot;" />
  49. <!--日志根据日期滚动-->
  50. <param name="RollingStyle" value="Date" />
  51. <param name="Encoding" value="utf-8" />
  52. <!--信息日志布局-->
  53. <layout type="log4net.Layout.PatternLayout">
  54. <param name="ConversionPattern" value="&lt;!--信息头&gt;%n日志时间:%d [%t] &lt;BR&gt;%n日志级别:%-5p %n%m %n &lt;信息尾&gt;" />
  55. </layout>
  56. </appender>
  57. </log4net>
  58. <!-- To customize the asp.net core module uncomment and edit the following section.
  59. For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
  60. <!--
  61. <system.webServer>
  62. <handlers>
  63. <remove name="aspNetCore"/>
  64. <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
  65. </handlers>
  66. <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  67. </system.webServer>
  68. -->
  69. </configuration>