Skip to content

Commit

Permalink
[FLINK-17527][flink-dist] Rename yarn log4j/logback configuration fil…
Browse files Browse the repository at this point in the history
…es so that they could be reused
  • Loading branch information
wangyang0918 authored and tillrohrmann committed May 19, 2020
1 parent 87e92dd commit 7d91197
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/monitoring/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Log4j2 is controlled using property files. In Flink's case, the file is usually
Flink ships with the following default properties files:

- `log4j-cli.properties`: Used by the Flink command line client (e.g. `flink run`) (not code executed on the cluster)
- `log4j-yarn-session.properties`: Used by the Flink command line client when starting a YARN session (`yarn-session.sh`)
- `log4j-session.properties`: Used by the Flink command line client when starting a YARN session (`yarn-session.sh`)
- `log4j.properties`: JobManager/Taskmanager logs (both standalone and YARN)

### Compatibility with Log4j1
Expand Down
2 changes: 1 addition & 1 deletion docs/monitoring/logging.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Log4j2 is controlled using property files. In Flink's case, the file is usually
Flink ships with the following default properties files:

- `log4j-cli.properties`: Used by the Flink command line client (e.g. `flink run`) (not code executed on the cluster)
- `log4j-yarn-session.properties`: Used by the Flink command line client when starting a YARN session (`yarn-session.sh`)
- `log4j-session.properties`: Used by the Flink command line client when starting a YARN session (`yarn-session.sh`)
- `log4j.properties`: JobManager/Taskmanager logs (both standalone and YARN)

### Compatibility with Log4j1
Expand Down
2 changes: 1 addition & 1 deletion flink-dist/src/main/flink-bin/yarn-bin/yarn-session.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ JVM_ARGS="$JVM_ARGS -Xmx512m"
CC_CLASSPATH=`manglePathList $(constructFlinkClassPath):$INTERNAL_HADOOP_CLASSPATHS`

log=$FLINK_LOG_DIR/flink-$FLINK_IDENT_STRING-yarn-session-$HOSTNAME.log
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/log4j-yarn-session.properties -Dlog4j.configurationFile=file:"$FLINK_CONF_DIR"/log4j-yarn-session.properties -Dlogback.configurationFile=file:"$FLINK_CONF_DIR"/logback-yarn.xml"
log_setting="-Dlog.file="$log" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/log4j-session.properties -Dlog4j.configurationFile=file:"$FLINK_CONF_DIR"/log4j-session.properties -Dlogback.configurationFile=file:"$FLINK_CONF_DIR"/logback-session.xml"

$JAVA_RUN $JVM_ARGS -classpath "$CC_CLASSPATH" $log_setting org.apache.flink.yarn.cli.FlinkYarnSessionCli -j "$FLINK_LIB_DIR"/flink-dist*.jar "$@"

4 changes: 2 additions & 2 deletions flink-scala-shell/start-script/start-scala-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ then
LOGBACK_CONFIG=logback.xml
elif [[ $1 = "yarn" ]]
then
LOG4J_CONFIG=log4j-yarn-session.properties
LOGBACK_CONFIG=logback-yarn.xml
LOG4J_CONFIG=log4j-session.properties
LOGBACK_CONFIG=logback-session.xml
FLINK_CLASSPATH=$FLINK_CLASSPATH:$HADOOP_CLASSPATH:$HADOOP_CONF_DIR:$YARN_CONF_DIR
fi

Expand Down

0 comments on commit 7d91197

Please sign in to comment.