log4j.properties 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. ### \u8BBE\u7F6E###
  2. log4j.rootLogger = debug,stdout
  3. ### \u8F93\u51FA\u4FE1\u606F\u5230\u63A7\u5236\u62AC ###
  4. log4j.appender.stdout = org.apache.log4j.ConsoleAppender
  5. log4j.appender.stdout.Target = System.out
  6. log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
  7. log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n
  8. #log4j.appender.my = MyAppender
  9. #log4j.appender.my.account = cosco
  10. log4j.appender.info = org.apache.log4j.FileAppender
  11. log4j.appender.info.File = e:/logs/log.log
  12. log4j.appender.info.Append = true
  13. log4j.appender.info.Threshold = DEBUG
  14. log4j.appender.info.layout = org.apache.log4j.PatternLayout
  15. log4j.appender.info.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
  16. ### \u8F93\u51FADEBUG \u7EA7\u522B\u4EE5\u4E0A\u7684\u65E5\u5FD7\u5230=E://logs/error.log ###
  17. log4j.appender.D = org.apache.log4j.DailyRollingFileAppender
  18. log4j.appender.D.File = e:/logs/log.log
  19. log4j.appender.D.Append = true
  20. log4j.appender.D.Threshold = DEBUG
  21. log4j.appender.D.layout = org.apache.log4j.PatternLayout
  22. log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n
  23. ### \u8F93\u51FAERROR \u7EA7\u522B\u4EE5\u4E0A\u7684\u65E5\u5FD7\u5230=E://logs/error.log ###
  24. log4j.appender.E = org.apache.log4j.DailyRollingFileAppender
  25. log4j.appender.E.File =e:/logs/error.log
  26. log4j.appender.E.Append = true
  27. log4j.appender.E.Threshold = ERROR
  28. log4j.appender.E.layout = org.apache.log4j.PatternLayout
  29. log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n