diff --git a/serving/build.gradle b/serving/build.gradle index 6e599c19108..1d79dabae55 100644 --- a/serving/build.gradle +++ b/serving/build.gradle @@ -52,7 +52,10 @@ startScripts { defaultJvmOpts = [] doLast { String text = unixScript.text.replace('exec "$JAVACMD" "$@"', 'exec env OMP_NUM_THREADS="1" MXNET_ENGINE_TYPE="NaiveEngine" TF_CPP_MIN_LOG_LEVEL=1 TF_NUM_INTRAOP_THREADS=1 "$JAVACMD" "$@"') - text = text.replace('DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-DMODEL_SERVER_HOME=${APP_HOME} -Dlog4j.configurationFile=${APP_HOME}/conf/log4j2.xml"') + text = text.replace('DEFAULT_JVM_OPTS=""', 'if [[ "${MODEL_SERVER_HOME}" = "" ]] ; then\n' + + ' export MODEL_SERVER_HOME=${APP_HOME}\n' + + 'fi\n' + + 'DEFAULT_JVM_OPTS="-Dlog4j.configurationFile=${APP_HOME}/conf/log4j2.xml"\n') unixScript.text = text } } diff --git a/serving/src/main/conf/log4j2.xml b/serving/src/main/conf/log4j2.xml index 7b430e3b511..0e9dbe0600f 100644 --- a/serving/src/main/conf/log4j2.xml +++ b/serving/src/main/conf/log4j2.xml @@ -6,8 +6,8 @@ %d{yyyy-MM-dd HH:mm:ss} %-5p %m%n