HBASE-26870 Log4j2 integration is incorrect in nighly's client integration test (#4251)

Signed-off-by: Sean Busbey <busbey@apache.org>
This commit is contained in:
Duo Zhang 2022-03-21 10:01:51 +08:00 committed by GitHub
parent 53a7ca794a
commit 0d7638d66d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 16 deletions

View File

@ -198,23 +198,21 @@ echo "Writing out configuration for HBase."
rm -rf "${working_dir}/hbase-conf"
mkdir "${working_dir}/hbase-conf"
if [ -f "${component_install}/conf/log4j2.xml" ]; then
cp "${component_install}/conf/log4j2.xml" "${working_dir}/hbase-conf/log4j2.xml"
if [ -f "${component_install}/conf/log4j2.properties" ]; then
cp "${component_install}/conf/log4j2.properties" "${working_dir}/hbase-conf/log4j2.properties"
else
cat >"${working_dir}/hbase-conf/log4j2.xml" <<EOF
<Configuration>
<Appenders>
<!-- Console appender -->
<Console name="console" target="SYSTEM_ERR">
<PatternLayout pattern="%d{ISO8601} %-5p [%t] %c{2}: %.1000m%n" />
</Console>
</Appenders>
<Loggers>
<Root level="${sys:hbase.root.logger.level:-info}">
<AppenderRef ref="${sys:hbase.root.logger.appender:-console}" />
</Root>
</Loggers>
</Configuration>
cat >"${working_dir}/hbase-conf/log4j2.properties" <<EOF
status = debug
dest = err
name = PropertiesConfig
appender.console.type = Console
appender.console.target = SYSTEM_ERR
appender.console.name = Console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{ISO8601} %-5p [%t] %c{2}: %.1000m%n
rootLogger = ${sys:hbase.root.logger:-INFO,console}
EOF
fi