feat(config): 支持通过环境变量或 VM 参数指定数据目录.

主要是为 Docker 镜像支持, 这样可以在镜像中指定数据目录, 方便设置持久卷或者文件映射.
This commit is contained in:
2022-02-26 12:00:16 +08:00
parent 737ac9a08a
commit b3c63e5abe
3 changed files with 57 additions and 17 deletions

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<included>
<define name="DATA_LOGS" class="net.lamgc.scalabot.LogDirectorySupplier"/>
<appender name="STD_OUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{HH:mm:ss.SSS} %5level][%logger{36}][%thread]: %msg%n</pattern>
@ -20,7 +22,7 @@
</appender>
<appender name="FILE_OUT" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>data/logs/latest.log</file>
<file>${DATA_LOGS}/latest.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>data/logs/%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<maxHistory>30</maxHistory>