提交 ae2c760c 编写于 作者: 武汉红喜's avatar 武汉红喜

logback-spring.xml

上级 9a58ca96
logging.level.org.springframework.boot: DEBUG
\ No newline at end of file
logging.level.org.springframework.boot: DEBUG
logging.file: /data/logs/whatsmars/whatsmars.log
logging.file-rolling: /data/logs/whatsmars/%d{yyyy-MM}/whatsmars.log
logging.max-file-size: 100MB
logging.max-history: 365
logging.total-size-cap: 20GB
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml" />
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/spring.log}"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<logger name="org.hongxi.whatsmars.boot.sample.logback" level="DEBUG" />
<springProfile name="staging">
<logger name="org.hongxi.whatsmars.boot.sample.logback" level="TRACE" />
</springProfile>
<springProperty name="LOG_FILE_ROLLING" source="logging.file-rolling" defaultValue="${LOG_FILE}"/>
<springProperty name="LOG_MAX_FILE_SIZE" source="logging.max-file-size" defaultValue="10MB"/>
<springProperty name="LOG_MAX_HISTORY" source="logging.max-history" defaultValue="7"/>
<springProperty name="LOG_TOTAL_SIZE_CAP" source="logging.total-size-cap" defaultValue="50MB"/>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_FILE_ROLLING}-%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<maxFileSize>${LOG_MAX_FILE_SIZE}</maxFileSize>
<maxHistory>${LOG_MAX_HISTORY}</maxHistory>
<totalSizeCap>${LOG_TOTAL_SIZE_CAP}</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
</configuration>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册