diff --git a/bin/wayang-submit b/bin/wayang-submit index a75380a68..2af90fb06 100755 --- a/bin/wayang-submit +++ b/bin/wayang-submit @@ -129,7 +129,7 @@ FLAGS+=( ) if [ "${FLAG_LOG}" = "true" ]; then - FLAGS+=("-Dlog4j.configuration=file://${WAYANG_CONF}/log4j.properties") + FLAGS+=("-Dlog4j2.configurationFile=file://${WAYANG_CONF}/log4j2.properties") fi if [ "${FLAG_WAYANG}" = "true" ]; then diff --git a/conf/log4j2.properties b/conf/log4j2.properties new file mode 100644 index 000000000..c4785121f --- /dev/null +++ b/conf/log4j2.properties @@ -0,0 +1,29 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Default Log4j 2 configuration for bin/wayang-submit. +# It is only loaded when FLAG_LOG=true is set. + +# Log to stderr so that logs do not mix with the output of the application. +appender.console.type = Console +appender.console.name = console +appender.console.target = SYSTEM_ERR +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n + +rootLogger.level = info +rootLogger.appenderRef.console.ref = console diff --git a/wayang-assembly/README.md b/wayang-assembly/README.md index 52c59b3b6..84d59b2d8 100644 --- a/wayang-assembly/README.md +++ b/wayang-assembly/README.md @@ -89,4 +89,6 @@ docker run --rm \ Additional platform libraries, such as JDBC drivers, can be supplied with `WAYANG_EXTRA_CLASSPATH`. A custom Wayang configuration can be mounted at `${WAYANG_HOME}/conf/wayang.properties` and activated with `FLAG_WAYANG=true`. +Logging is configured with Log4j 2: set `FLAG_LOG=true` to load +`${WAYANG_HOME}/conf/log4j2.properties`, which can be edited or replaced by a mounted file. Applications still need to register the platform plugins they use.