logback-spring.xml 1.1 KB

1234567891011121314151617181920212223
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <springProperty scope="context" name="LOG_PATH" source="logging.file.path" defaultValue="/tmp" />
  4. <include resource="org/springframework/boot/logging/logback/defaults.xml" />
  5. <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
  6. <appender name="TIME_FILE"
  7. class="ch.qos.logback.core.rolling.RollingFileAppender">
  8. <encoder>
  9. <pattern>${FILE_LOG_PATTERN}</pattern>
  10. </encoder>
  11. <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  12. <fileNamePattern>${LOG_PATH}/meter-reading-service.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  13. <maxHistory>365</maxHistory>
  14. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  15. <maxFileSize>100MB</maxFileSize>
  16. </timeBasedFileNamingAndTriggeringPolicy>
  17. </rollingPolicy>
  18. </appender>
  19. <root level="INFO">
  20. <appender-ref ref="CONSOLE" />
  21. <appender-ref ref="TIME_FILE" />
  22. </root>
  23. </configuration>