mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 06:14:14 +00:00
Use FTB_DIR for log4j2 patched files...hypothetically (#2691)
This commit is contained in:
parent
e38cc6ec3b
commit
fc5f7fa5d5
1 changed files with 10 additions and 3 deletions
|
@ -45,10 +45,17 @@ fi
|
|||
canUseRollingLogs=true
|
||||
useFallbackJvmFlag=false
|
||||
|
||||
if [[ ${FTB_DIR:-} ]]; then
|
||||
SERVER_DIR="$FTB_DIR"
|
||||
else
|
||||
SERVER_DIR=/data
|
||||
fi
|
||||
|
||||
|
||||
patchLog4jConfig() {
|
||||
file=${1?}
|
||||
url=${2?}
|
||||
if ! get -o "$file" "$url"; then
|
||||
if ! get -o "${SERVER_DIR}/${file}" "$url"; then
|
||||
log "ERROR: failed to download corrected log4j config, fallback to JVM flag"
|
||||
useFallbackJvmFlag=true
|
||||
return 1
|
||||
|
@ -94,14 +101,14 @@ if isTrue "${ENABLE_ROLLING_LOGS:-false}"; then
|
|||
exit 1
|
||||
fi
|
||||
# Set up log configuration
|
||||
LOGFILE="/data/log4j2.xml"
|
||||
LOGFILE="${SERVER_DIR}/log4j2.xml"
|
||||
if [ ! -e "$LOGFILE" ]; then
|
||||
log "Creating log4j2.xml in ${LOGFILE}"
|
||||
cp /image/log4j2.xml "$LOGFILE"
|
||||
else
|
||||
log "log4j2.xml already created, skipping"
|
||||
fi
|
||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
||||
JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}"
|
||||
fi
|
||||
|
||||
# Optional disable console
|
||||
|
|
Loading…
Reference in a new issue