Skip to content

Commit

Permalink
[FLINK-11224][scala-shell] Log is missing in scala-shell
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zjffdu authored and dawidwys committed Jan 11, 2019
1 parent e0efabe commit be47061
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions flink-scala-shell/start-script/start-scala-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,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"
Expand Down

0 comments on commit be47061

Please sign in to comment.