IMPALA-2853: prevent hadoop info logging from getting into generated SQL

The hadoop shell command was used by some data loading steps. When
invoked during data loading, there was no log4j config file in
$HADOOP_CONF_DIR, so it used the default logging settings, which sent
INFO and above to stdout.

This patch adds a log4j.properties file to where it will be picked up by
the hadoop shell command after impala-config.sh is sourced. INFO and
above are sent to stderr instead of stdout.

Change-Id: I94ae8a363504c1e9c7d16d096711bb0ae637f271
Reviewed-on: http://gerrit.cloudera.org:8080/1798
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Tim Armstrong
2016-01-15 10:29:23 -08:00
committed by Internal Jenkins
parent 43de306d17
commit 05931e0e7f
2 changed files with 12 additions and 0 deletions

View File

@@ -158,6 +158,7 @@ if ${CLUSTER_DIR}/admin is_kerberized; then
fi
generate_config postgresql-hive-site.xml.template hive-site.xml
generate_config log4j.properties.template log4j.properties
generate_config hive-log4j.properties.template hive-log4j.properties
generate_config hbase-site.xml.template hbase-site.xml
generate_config authz-policy.ini.template authz-policy.ini

View File

@@ -0,0 +1,11 @@
# Define some default values that can be overridden by system properties
# Don't use hadoop.root.logger because Hadoop's config scripts override it
impala.hadoop.root.logger=INFO,console
# Define the root logger to the system property "impala.hadoop.root.logger".
log4j.rootLogger=${impala.hadoop.root.logger}
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.err
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n