HIVE-13032: Hive services need HADOOP_CLIENT_OPTS for proper log4j2 initialization (Prasanth Jayachandran reviewed by Sergey Shelukhin)
diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt
index f9388c1..2e56113 100644
--- a/RELEASE_NOTES.txt
+++ b/RELEASE_NOTES.txt
@@ -818,6 +818,7 @@
* [HIVE-12964] - TestOperationLoggingAPIWithMr,TestOperationLoggingAPIWithTez fail on branch-2.0 (with Java 7, at least)
* [HIVE-12985] - distribution configs are wrong and out of date
* [HIVE-13024] - schematool does not log anywhere
+ * [HIVE-13032] - Hive services need HADOOP_CLIENT_OPTS for proper log4j2 initialization
diff --git a/bin/ext/schemaTool.sh b/bin/ext/schemaTool.sh
index 473ee90..94c56ef 100644
--- a/bin/ext/schemaTool.sh
+++ b/bin/ext/schemaTool.sh
@@ -17,7 +17,6 @@
export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} "
schemaTool() {
- export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-log4j2.properties"
HIVE_OPTS=''
CLASS=org.apache.hive.beeline.HiveSchemaTool
execHiveCmd $CLASS "$@"
diff --git a/bin/hive b/bin/hive
index 52433ec..434d5db 100755
--- a/bin/hive
+++ b/bin/hive
@@ -312,6 +312,9 @@
fi
done
+# to initialize logging for all services
+export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-log4j2.properties "
+
if [ "$TORUN" = "" ] ; then
echo "Service $SERVICE not found"
echo "Available Services: $SERVICE_LIST"