Repository: sentry Updated Branches: refs/heads/master 1e6ea0ea2 -> 7138db63c
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/7138db63 Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/7138db63 Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/7138db63 Branch: refs/heads/master Commit: 7138db63c7341f60b11e683022cd8a4ffc42a962 Parents: 1e6ea0e Author: Colm O hEigeartaigh <cohei...@apache.org> Authored: Mon Oct 17 11:08:55 2016 +0100 Committer: Colm O hEigeartaigh <cohei...@apache.org> Committed: Mon Oct 17 11:08:55 2016 +0100 ---------------------------------------------------------------------- .../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/7138db63/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"); } }