mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-12 11:35:09 +00:00
Use FTB_DIR for log4j2 patched files...hypothetically (#2691)
This commit is contained in:
+10
-3
@@ -45,10 +45,17 @@ fi
|
|||||||
canUseRollingLogs=true
|
canUseRollingLogs=true
|
||||||
useFallbackJvmFlag=false
|
useFallbackJvmFlag=false
|
||||||
|
|
||||||
|
if [[ ${FTB_DIR:-} ]]; then
|
||||||
|
SERVER_DIR="$FTB_DIR"
|
||||||
|
else
|
||||||
|
SERVER_DIR=/data
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
patchLog4jConfig() {
|
patchLog4jConfig() {
|
||||||
file=${1?}
|
file=${1?}
|
||||||
url=${2?}
|
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"
|
log "ERROR: failed to download corrected log4j config, fallback to JVM flag"
|
||||||
useFallbackJvmFlag=true
|
useFallbackJvmFlag=true
|
||||||
return 1
|
return 1
|
||||||
@@ -94,14 +101,14 @@ if isTrue "${ENABLE_ROLLING_LOGS:-false}"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Set up log configuration
|
# Set up log configuration
|
||||||
LOGFILE="/data/log4j2.xml"
|
LOGFILE="${SERVER_DIR}/log4j2.xml"
|
||||||
if [ ! -e "$LOGFILE" ]; then
|
if [ ! -e "$LOGFILE" ]; then
|
||||||
log "Creating log4j2.xml in ${LOGFILE}"
|
log "Creating log4j2.xml in ${LOGFILE}"
|
||||||
cp /image/log4j2.xml "$LOGFILE"
|
cp /image/log4j2.xml "$LOGFILE"
|
||||||
else
|
else
|
||||||
log "log4j2.xml already created, skipping"
|
log "log4j2.xml already created, skipping"
|
||||||
fi
|
fi
|
||||||
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
|
JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Optional disable console
|
# Optional disable console
|
||||||
|
|||||||
Reference in New Issue
Block a user