Skip to content

Commit fc5f7fa

Browse files
authored
Use FTB_DIR for log4j2 patched files...hypothetically (#2691)
1 parent e38cc6e commit fc5f7fa

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/start-finalExec

+10-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@ fi
4545
canUseRollingLogs=true
4646
useFallbackJvmFlag=false
4747

48+
if [[ ${FTB_DIR:-} ]]; then
49+
SERVER_DIR="$FTB_DIR"
50+
else
51+
SERVER_DIR=/data
52+
fi
53+
54+
4855
patchLog4jConfig() {
4956
file=${1?}
5057
url=${2?}
51-
if ! get -o "$file" "$url"; then
58+
if ! get -o "${SERVER_DIR}/${file}" "$url"; then
5259
log "ERROR: failed to download corrected log4j config, fallback to JVM flag"
5360
useFallbackJvmFlag=true
5461
return 1
@@ -94,14 +101,14 @@ if isTrue "${ENABLE_ROLLING_LOGS:-false}"; then
94101
exit 1
95102
fi
96103
# Set up log configuration
97-
LOGFILE="/data/log4j2.xml"
104+
LOGFILE="${SERVER_DIR}/log4j2.xml"
98105
if [ ! -e "$LOGFILE" ]; then
99106
log "Creating log4j2.xml in ${LOGFILE}"
100107
cp /image/log4j2.xml "$LOGFILE"
101108
else
102109
log "log4j2.xml already created, skipping"
103110
fi
104-
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
111+
JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}"
105112
fi
106113

107114
# Optional disable console

0 commit comments

Comments
 (0)