Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log4j2 template for kyuubi repl commands #6196

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bin/beeline
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ else
KYUUBI_BEELINE_CLASSPATH="${KYUUBI_BEELINE_JARS}/*:${HADOOP_CONF_DIR}:${YARN_CONF_DIR}"
fi

if [[ -f ${KYUUBI_CONF_DIR}/log4j2-repl.xml ]]; then
KYUUBI_CTL_JAVA_OPTS="${KYUUBI_CTL_JAVA_OPTS} -Dlog4j2.configurationFile=log4j2-repl.xml"
fi

exec ${RUNNER} ${KYUUBI_BEELINE_OPTS} -cp ${KYUUBI_BEELINE_CLASSPATH} $CLASS "$@"
4 changes: 4 additions & 0 deletions bin/kyuubi-admin
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ else
KYUUBI_CLASSPATH="${KYUUBI_JAR_DIR}/*:${KYUUBI_CONF_DIR}:${HADOOP_CONF_DIR}:${YARN_CONF_DIR}"
fi

if [[ -f ${KYUUBI_CONF_DIR}/log4j2-repl.xml ]]; then
KYUUBI_CTL_JAVA_OPTS="${KYUUBI_CTL_JAVA_OPTS} -Dlog4j2.configurationFile=log4j2-repl.xml"
fi

exec ${RUNNER} ${KYUUBI_CTL_JAVA_OPTS} -cp ${KYUUBI_CLASSPATH} $CLASS "$@"
4 changes: 4 additions & 0 deletions bin/kyuubi-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ else
KYUUBI_CLASSPATH="${KYUUBI_JAR_DIR}/*:${KYUUBI_CONF_DIR}:${HADOOP_CONF_DIR}:${YARN_CONF_DIR}"
fi

if [[ -f ${KYUUBI_CONF_DIR}/log4j2-repl.xml ]]; then
KYUUBI_CTL_JAVA_OPTS="${KYUUBI_CTL_JAVA_OPTS} -Dlog4j2.configurationFile=log4j2-repl.xml"
fi

exec ${RUNNER} ${KYUUBI_CTL_JAVA_OPTS} -cp ${KYUUBI_CLASSPATH} $CLASS "$@"
4 changes: 4 additions & 0 deletions bin/kyuubi-zk-cli
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ else
KYUUBI_CLASSPATH="${KYUUBI_JAR_DIR}/*:${KYUUBI_CONF_DIR}:${HADOOP_CONF_DIR}:${YARN_CONF_DIR}"
fi

if [[ -f ${KYUUBI_CONF_DIR}/log4j2-repl.xml ]]; then
KYUUBI_CTL_JAVA_OPTS="${KYUUBI_CTL_JAVA_OPTS} -Dlog4j2.configurationFile=log4j2-repl.xml"
fi

exec ${RUNNER} ${KYUUBI_JAVA_OPTS} -cp ${KYUUBI_CLASSPATH} $CLASS "$@"
36 changes: 36 additions & 0 deletions conf/log4j2-repl.xml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
-->

<!-- Provide log4j2.xml.template to fix `ERROR Filters contains invalid attributes "onMatch", "onMismatch"`, see KYUUBI-2247 -->
<!-- Extra logging related to initialization of Log4j.
Set to debug or trace if log4j initialization is failing. -->
<Configuration status="INFO">
<Appenders>
<Console name="stdout" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %p %tn %c: %m%n%ex"/>
<Filters>
<RegexFilter regex=".*Thrift error occurred during processing of message.*" onMatch="DENY" onMismatch="NEUTRAL"/>
wForget marked this conversation as resolved.
Show resolved Hide resolved
</Filters>
</Console>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="stdout"/>
</Root>
</Loggers>
</Configuration>
2 changes: 1 addition & 1 deletion conf/log4j2.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<Root level="INFO">
<AppenderRef ref="stdout"/>
</Root>
<Logger name="org.apache.kyuubi.ctl.ServiceControlCli" level="error" additivity="false">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class has been removed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you created a separate log4j2-repl.xml, do we need such conf in log4j2.xml then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you created a separate log4j2-repl.xml, do we need such conf in log4j2.xml then?

I think it can be kept because user may not have created log4j2-repl.xml, in which case log4j2.xml can also be used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM if it works, please manually check it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM if it works, please manually check it

I have tested manually and it works fine.

<Logger name="org.apache.kyuubi.ctl" level="error" additivity="false">
<AppenderRef ref="stdout"/>
</Logger>
<!--
Expand Down
Loading