绍兴公厕平台代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.6 KiB

3 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration debug="false" scan="false" scanPeriod="60 seconds">
  3. <property name="LOG_HOME" value="./logs/logback"/>
  4. <property name="appName" value="lzy-logDemo"/>
  5. <!-- 定义控制台输出 -->
  6. <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
  7. <layout class="ch.qos.logback.classic.PatternLayout">
  8. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} - [%thread] - %-5level - %logger{50} - %msg%n</pattern>
  9. </layout>
  10. </appender>
  11. <appender name="appLogAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
  12. <!-- 指定日志文件的名称 -->
  13. <file>${LOG_HOME}/${appName}.log</file>
  14. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  15. <fileNamePattern>${LOG_HOME}/${appName}-%d{yyyy-MM-dd}-%i.log</fileNamePattern>
  16. <MaxHistory>30</MaxHistory>
  17. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  18. <MaxFileSize>10MB</MaxFileSize>
  19. </timeBasedFileNamingAndTriggeringPolicy>
  20. </rollingPolicy>
  21. <layout class="ch.qos.logback.classic.PatternLayout">
  22. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [ %thread ] - [ %-5level ] [ %logger{50} : %line ] - %msg%n</pattern>
  23. </layout>
  24. </appender>
  25. <!-- 日志输出级别 -->
  26. <logger name="org.springframework" level="debug" additivity="false"/>
  27. <logger name="com.lzy.logdemo" level="debug"/>
  28. <root level="INFO">
  29. <appender-ref ref="stdout"/>
  30. <appender-ref ref="appLogAppender"/>
  31. </root>
  32. </configuration>