logback.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <configuration scan="true" scanPeriod="60 seconds">
  3. <!-- <include resource="org/springframework/boot/logging/logback/base.xml" /> -->
  4. <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
  5. <encoder>
  6. <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
  7. </encoder>
  8. </appender>
  9. <appender name="springboot"
  10. class="ch.qos.logback.core.rolling.RollingFileAppender">
  11. <!-- <Encoding>UTF-8</Encoding> -->
  12. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  13. <FileNamePattern>logs/logback/springboot_%d{yyyy-M-d}.log
  14. </FileNamePattern>
  15. <MaxHistory>10</MaxHistory>
  16. </rollingPolicy>
  17. <encoder>
  18. <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
  19. </encoder>
  20. </appender>
  21. <appender name="smile"
  22. class="ch.qos.logback.core.rolling.RollingFileAppender">
  23. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  24. <FileNamePattern>logs/logback/smile_%d{yyyy-M-d}.log
  25. </FileNamePattern>
  26. <MaxHistory>10</MaxHistory>
  27. </rollingPolicy>
  28. <encoder>
  29. <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
  30. </encoder>
  31. </appender>
  32. <appender name="mysql"
  33. class="ch.qos.logback.core.rolling.RollingFileAppender">
  34. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  35. <FileNamePattern>logs/logback/mysql_%d{yyyy-M-d}.log
  36. </FileNamePattern>
  37. <MaxHistory>10</MaxHistory>
  38. </rollingPolicy>
  39. <encoder>
  40. <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
  41. </encoder>
  42. </appender>
  43. <appender name="neo4j"
  44. class="ch.qos.logback.core.rolling.RollingFileAppender">
  45. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  46. <FileNamePattern>logs/logback/neo4j_%d{yyyy-M-d}.log
  47. </FileNamePattern>
  48. <MaxHistory>10</MaxHistory>
  49. </rollingPolicy>
  50. <encoder>
  51. <pattern>%d{yyyy-M-d HH:mm:ss} %t %p %m%n</pattern>
  52. </encoder>
  53. </appender>
  54. <root level="INFO">
  55. <appender-ref ref="stdout" />
  56. </root>
  57. <!-- spring boot 日志 -->
  58. <logger name="org.springframework.boot">
  59. <appender-ref ref="springboot" />
  60. </logger>
  61. <!-- 全包日志 -->
  62. <logger name="com.xczg">
  63. <appender-ref ref="smile" />
  64. </logger>
  65. <!-- mybatis sql日志 -->
  66. <logger name="mapper">
  67. <appender-ref ref="mysql" />
  68. </logger>
  69. <!-- mybatis neo4j日志 -->
  70. <logger name="neo4jmapper">
  71. <appender-ref ref="neo4j" />
  72. </logger>
  73. </configuration>