diff --git a/Dockerfile b/Dockerfile index 54fbe76fe5080..6b5c5cb4597f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,6 +105,7 @@ RUN mkdir -p bin target/uberjar && \ mkdir -p bin /root/.crossdata/ COPY --from=builder /app/source/target/uberjar/metabase.jar /app/target/uberjar/ COPY --from=builder /app/source/bin/start /app/bin/ +COPY --from=builder /app/source/resources/log4j2.xml /app/target/log/ COPY --from=builder /root/defaultsecrets/* /root/defaultsecrets/ COPY --from=builder /root/kms/* /root/kms/ diff --git a/bin/start b/bin/start index dd0e50caa0ea9..7cb398dfe978a 100755 --- a/bin/start +++ b/bin/start @@ -11,6 +11,10 @@ if [ "$PORT" ]; then export MB_JETTY_PORT="$PORT" fi +source /root/kms/kms_utils.sh +source /root/kms/b-log.sh + + source /root/kms/secrets.sh @@ -133,6 +137,7 @@ JAVA_OPTS="$JAVA_OPTS -XX:+IgnoreUnrecognizedVMOptions" # Don't barf if we see a JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true" # don't try to start AWT. Not sure this does anything but better safe than wasting memory JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8" # Use UTF-8 JAVA_OPTS="$JAVA_OPTS --add-modules=java.xml.bind" # Enable access to java.xml.bind module (Java 9) +JAVA_OPTS="$JAVA_OPTS -Dlog4j.configuration=target/log/log4j2.xml" # Heap Size (defaults to 1g min, 95% of the given memory as max) CURRENT_MEMORY=$MARATHON_APP_RESOURCE_MEM @@ -144,6 +149,8 @@ if [ "$JMX" ]; then JAVA_OPTS="$JAVA_OPTS $JMX" fi -echo "Using these JAVA_OPTS: ${JAVA_OPTS}" +INFO "Using these JAVA_OPTS: ${JAVA_OPTS}" + +INFO "exec java $JAVA_OPTS -jar ./target/uberjar/metabase.jar" exec java $JAVA_OPTS -jar ./target/uberjar/metabase.jar diff --git a/resources/kms/secrets.sh b/resources/kms/secrets.sh index cc7b1046896db..d1e68faaebedb 100755 --- a/resources/kms/secrets.sh +++ b/resources/kms/secrets.sh @@ -1,10 +1,6 @@ #!/bin/bash -source /root/kms/kms_utils.sh -source /root/kms/b-log.sh - - TENANT_UNDERSCORE=${TENANT_NAME//-/_} export TENANT_NORM="${TENANT_UNDERSCORE^^}" diff --git a/resources/log4j2.xml b/resources/log4j2.xml new file mode 100644 index 0000000000000..c1a2eebf04388 --- /dev/null +++ b/resources/log4j2.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +