diff --git a/azkaban-exec-server/src/main/bash/azkaban-executor-start.sh b/azkaban-exec-server/src/main/bash/azkaban-executor-start.sh
index 510373e..9a3ed70 100755
--- a/azkaban-exec-server/src/main/bash/azkaban-executor-start.sh
+++ b/azkaban-exec-server/src/main/bash/azkaban-executor-start.sh
@@ -50,9 +50,12 @@ if [[ -z "$AZKABAN_OPTS" ]]; then
fi
# Set the log4j configuration file
if [ -f $conf/log4j.properties ]; then
- AZKABAN_OPTS="$AZKABAN_OPTS -Dlog4j.configuration=file:$conf/log4j.properties"
+ AZKABAN_OPTS="$AZKABAN_OPTS -Dlog4j.configuration=file:$conf/log4j.properties -Dlog4j.log.dir=$azkaban_dir/logs"
+else
+ echo "Exit with error: $conf/log4j.properties file doesn't exist."
+ exit 1;
fi
-AZKABAN_OPTS="$AZKABAN_OPTS -server -Dcom.sun.management.jmxremote -Djava.io.tmpdir=$tmpdir -Dexecutorport=$executorport -Dserverpath=$serverpath -Dlog4j.log.dir=$azkaban_dir/logs"
+AZKABAN_OPTS="$AZKABAN_OPTS -server -Dcom.sun.management.jmxremote -Djava.io.tmpdir=$tmpdir -Dexecutorport=$executorport -Dserverpath=$serverpath"
java $AZKABAN_OPTS $JAVA_LIB_PATH -cp $CLASSPATH azkaban.execapp.AzkabanExecutorServer -conf $conf $@ &
diff --git a/azkaban-web-server/src/main/bash/azkaban-web-start.sh b/azkaban-web-server/src/main/bash/azkaban-web-start.sh
index 7c568e9..6550d56 100755
--- a/azkaban-web-server/src/main/bash/azkaban-web-start.sh
+++ b/azkaban-web-server/src/main/bash/azkaban-web-start.sh
@@ -49,9 +49,12 @@ if [[ -z "$AZKABAN_OPTS" ]]; then
fi
# Set the log4j configuration file
if [ -f $conf/log4j.properties ]; then
- AZKABAN_OPTS="$AZKABAN_OPTS -Dlog4j.configuration=file:$conf/log4j.properties"
+ AZKABAN_OPTS="$AZKABAN_OPTS -Dlog4j.configuration=file:$conf/log4j.properties -Dlog4j.log.dir=$azkaban_dir/logs"
+else
+ echo "Exit with error: $conf/log4j.properties file doesn't exist."
+ exit 1;
fi
-AZKABAN_OPTS="$AZKABAN_OPTS -server -Dcom.sun.management.jmxremote -Djava.io.tmpdir=$tmpdir -Dexecutorport=$executorport -Dserverpath=$serverpath -Dlog4j.log.dir=$azkaban_dir/logs"
+AZKABAN_OPTS="$AZKABAN_OPTS -server -Dcom.sun.management.jmxremote -Djava.io.tmpdir=$tmpdir -Dexecutorport=$executorport -Dserverpath=$serverpath"
java $AZKABAN_OPTS $JAVA_LIB_PATH -cp $CLASSPATH azkaban.webapp.AzkabanWebServer -conf $conf $@ &