sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ak...@apache.org
Subject sentry git commit: SENTRY-1504 - NPE in log4j.properties parsing
Date Sat, 11 Mar 2017 01:27:00 GMT
Repository: sentry
Updated Branches:
  refs/heads/sentry-ha-redesign 2fbaacc8e -> f0e1dfbd0


SENTRY-1504 - NPE in log4j.properties parsing


Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/f0e1dfbd
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/f0e1dfbd
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/f0e1dfbd

Branch: refs/heads/sentry-ha-redesign
Commit: f0e1dfbd0c6eb21219993c84eff49d4ad3da0e5e
Parents: 2fbaacc
Author: Alexander Kolbasov <akolb@cloudera.com>
Authored: Fri Mar 10 17:26:41 2017 -0800
Committer: Alexander Kolbasov <akolb@cloudera.com>
Committed: Fri Mar 10 17:26:41 2017 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/sentry/SentryMain.java               | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/f0e1dfbd/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryMain.java
----------------------------------------------------------------------
diff --git a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryMain.java
b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryMain.java
index d321531..c1518ba 100644
--- a/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryMain.java
+++ b/sentry-core/sentry-core-common/src/main/java/org/apache/sentry/SentryMain.java
@@ -78,7 +78,8 @@ public class SentryMain {
         log4jProperties.setProperty("log4j.category.DataNucleus.Query", "INFO");
 
         // Enable debug log for DataNucleus.Query only when log.threshold is TRACE
-        if (log4jProperties.getProperty("log.threshold").equalsIgnoreCase("TRACE")) {
+        String logThreshold = log4jProperties.getProperty("log.threshold");
+        if (logThreshold != null && logThreshold.equalsIgnoreCase("TRACE")) {
           log4jProperties.setProperty("log4j.category.DataNucleus.Query", "DEBUG");
         }
       }


Mime
View raw message