log4j.xml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  3. <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
  4. <!-- <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender"> -->
  5. <!-- <layout class="org.apache.log4j.PatternLayout"> -->
  6. <!-- <param name="ConversionPattern" value="/n[%r][%p][%t] %d{HH:mm:ss,SSS} method:%l/n%m%n"/> -->
  7. <!-- </layout> -->
  8. <!-- </appender> -->
  9. <appender name="log.file" class="org.apache.log4j.RollingFileAppender">
  10. <param name="File" value="../log/userPlatform_info.log"/>
  11. <param name="Append" value="true" />
  12. <param name="MaxFileSize" value="50MB" />
  13. <param name="MaxBackupIndex" value="50" />
  14. <layout class="org.apache.log4j.PatternLayout">
  15. <param name="ConversionPattern" value="%d %5p %m%n"/>
  16. </layout>
  17. <filter class="org.apache.log4j.varia.LevelRangeFilter">
  18. <param name="LevelMin" value="INFO"/>
  19. <param name="LevelMax" value="INFO"/>
  20. </filter>
  21. </appender>
  22. <appender name="WARN" class="org.apache.log4j.DailyRollingFileAppender">
  23. <param name="File" value="../log/userPlatform_warn.log"/>
  24. <param name="Append" value="true" />
  25. <param name="MaxFileSize" value="50MB" />
  26. <param name="MaxBackupIndex" value="20" />
  27. <layout class="org.apache.log4j.PatternLayout">
  28. <param name="ConversionPattern" value="%d %5p %m%n"/>
  29. </layout>
  30. <filter class="org.apache.log4j.varia.LevelRangeFilter">
  31. <param name="LevelMin" value="WARN"/>
  32. <param name="LevelMax" value="WARN"/>
  33. </filter>
  34. </appender>
  35. <appender name="ERROR" class="org.apache.log4j.DailyRollingFileAppender">
  36. <param name="File" value="../log/userPlatform_error.log"/>
  37. <param name="Append" value="true" />
  38. <param name="MaxFileSize" value="50MB" />
  39. <param name="MaxBackupIndex" value="10" />
  40. <layout class="org.apache.log4j.PatternLayout">
  41. <param name="ConversionPattern" value="%d %5p %m%n"/>
  42. </layout>
  43. <filter class="org.apache.log4j.varia.LevelRangeFilter">
  44. <param name="LevelMin" value="ERROR"/>
  45. <param name="LevelMax" value="ERROR"/>
  46. </filter>
  47. </appender>
  48. <category name="com.yihu">
  49. <priority value="info" />
  50. <appender-ref ref="log.file" />
  51. <appender-ref ref="WARN" />
  52. <appender-ref ref="ERROR" />
  53. </category>
  54. <!-- <root> -->
  55. <!-- <priority value="STDOUT"/> -->
  56. <!-- <appender-ref ref="log.file"/> -->
  57. <!-- <appender-ref ref="WARN"/> -->
  58. <!-- </root> -->
  59. </log4j:configuration>