logback.xml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
  4. <property name="log.base" value="./log/disconf-web"/>
  5. <property name="log.monitor" value="./log/monitor"/>
  6. <property resource="rabbit.properties"/>
  7. <jmxConfigurator/>
  8. <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
  9. <Encoding>UTF-8</Encoding>
  10. <encoder>
  11. <pattern>%X{sessionId} %date [%thread] %-5level %logger{80} - %msg%n</pattern>
  12. </encoder>
  13. </appender>
  14. <appender name="logfile"
  15. class="ch.qos.logback.core.rolling.RollingFileAppender">
  16. <File>${log.base}.log</File>
  17. <Encoding>UTF-8</Encoding>
  18. <rollingPolicy
  19. class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  20. <FileNamePattern>${log.base}.log.%d{yyyy-MM-dd}</FileNamePattern>
  21. </rollingPolicy>
  22. <encoder>
  23. <pattern>%X{sessionId} %date [%thread] %-5level %logger{80} - %msg%n</pattern>
  24. </encoder>
  25. </appender>
  26. <appender name="monitorlog"
  27. class="ch.qos.logback.core.rolling.RollingFileAppender">
  28. <Encoding>UTF-8</Encoding>
  29. <File>${log.monitor}.log</File>
  30. <rollingPolicy
  31. class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  32. <FileNamePattern>${log.base}.log.%d{yyyy-MM-dd}</FileNamePattern>
  33. </rollingPolicy>
  34. <encoder>
  35. <pattern>%X{sessionId} %date [%thread] %-5level %logger{80} - %msg%n</pattern>
  36. </encoder>
  37. </appender>
  38. <logger name="com.baidu.disconf.web.tasks">
  39. <level value="INFO"/>
  40. <appender-ref ref="monitorlog"/>
  41. </logger>
  42. <logger name="com.baidu.disconf">
  43. <level value="INFO"/>
  44. </logger>
  45. <logger name="org.springframework">
  46. <level value="INFO"/>
  47. </logger>
  48. <logger name="net.sf.ehcache">
  49. <level value="ERROR"/>
  50. </logger>
  51. <logger name="org.springmodules">
  52. <level value="ERROR"/>
  53. </logger>
  54. <root>
  55. <level value="INFO"/>
  56. <appender-ref ref="stdout"/>
  57. <appender-ref ref="logfile"/>
  58. </root>
  59. </configuration>