You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by dw...@apache.org on 2019/01/11 09:27:57 UTC

[flink] branch release-1.6 updated: [FLINK-11224][scala-shell] Log is missing in scala-shell

This is an automated email from the ASF dual-hosted git repository.

dwysakowicz pushed a commit to branch release-1.6
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.6 by this push:
     new 99a89d2  [FLINK-11224][scala-shell] Log is missing in scala-shell
99a89d2 is described below

commit 99a89d215af1d0ed3dd235cd68b533ae61c10ba9
Author: Jeff Zhang <zj...@gmail.com>
AuthorDate: Fri Jan 11 17:20:02 2019 +0800

    [FLINK-11224][scala-shell] Log is missing in scala-shell
    
    Logging configuration was set only for scala-shell in yarn mode. This commit sets the configuration for local and remote mode in start-scala-shell.sh script as well.
---
 flink-scala-shell/start-script/start-scala-shell.sh | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/flink-scala-shell/start-script/start-scala-shell.sh b/flink-scala-shell/start-script/start-scala-shell.sh
index 033d505..cc6ebb0 100644
--- a/flink-scala-shell/start-script/start-scala-shell.sh
+++ b/flink-scala-shell/start-script/start-scala-shell.sh
@@ -75,15 +75,26 @@ do
     fi
 done
 
-log_setting=""
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+        FLINK_IDENT_STRING="$USER"
+fi
+
+MODE=$1
+LOG=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-scala-shell-$MODE-$HOSTNAME.log
 
-if [[ $1 = "yarn" ]]
+if [[ ($MODE = "local") || ($MODE = "remote") ]]
 then
-FLINK_CLASSPATH=$FLINK_CLASSPATH:$HADOOP_CLASSPATH:$HADOOP_CONF_DIR:$YARN_CONF_DIR
-log=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-scala-shell-yarn-$HOSTNAME.log
-log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/log4j-yarn-session.properties -Dlogback.configurationFile=file:"$FLINK_CONF_DIR"/logback-yarn.xml"
+    LOG4J_CONFIG=log4j.properties
+    LOGBACK_CONFIG=logback.xml
+elif [[ $1 = "yarn" ]]
+then
+    LOG4J_CONFIG=log4j-yarn-session.properties
+    LOGBACK_CONFIG=logback-yarn.xml
+    FLINK_CLASSPATH=$FLINK_CLASSPATH:$HADOOP_CLASSPATH:$HADOOP_CONF_DIR:$YARN_CONF_DIR
 fi
 
+log_setting="-Dlog.file="$LOG" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/$LOG4J_CONFIG -Dlogback.configurationFile=file:"$FLINK_CONF_DIR"/$LOGBACK_CONFIG"
+
 if ${EXTERNAL_LIB_FOUND}
 then
     java -Dscala.color -cp "$FLINK_CLASSPATH" $log_setting org.apache.flink.api.scala.FlinkShell $@ --addclasspath "$EXT_CLASSPATH"