You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/01/22 10:19:33 UTC
kylin git commit: KYLIN-1268 Take better care of DebugTomcat's log
Repository: kylin
Updated Branches:
refs/heads/2.x-staging da96c8f23 -> b6da9ed18
KYLIN-1268 Take better care of DebugTomcat's log
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b6da9ed1
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b6da9ed1
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b6da9ed1
Branch: refs/heads/2.x-staging
Commit: b6da9ed18dc0056a40672ad242c496258ffdeff8
Parents: da96c8f
Author: Li, Yang <ya...@ebay.com>
Authored: Fri Jan 22 17:19:24 2016 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Fri Jan 22 17:19:24 2016 +0800
----------------------------------------------------------------------
.../apache/kylin/rest/util/Log4jConfigListener.java | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/b6da9ed1/server/src/main/java/org/apache/kylin/rest/util/Log4jConfigListener.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/util/Log4jConfigListener.java b/server/src/main/java/org/apache/kylin/rest/util/Log4jConfigListener.java
index 19c76ea..23b327a 100644
--- a/server/src/main/java/org/apache/kylin/rest/util/Log4jConfigListener.java
+++ b/server/src/main/java/org/apache/kylin/rest/util/Log4jConfigListener.java
@@ -20,25 +20,28 @@ package org.apache.kylin.rest.util;
import javax.servlet.ServletContextEvent;
+import org.apache.kylin.common.KylinConfig;
+
public class Log4jConfigListener extends org.springframework.web.util.Log4jConfigListener {
- private boolean isTesting;
+ private boolean isDebugTomcat;
public Log4jConfigListener() {
- // set by DebugTomcat
- this.isTesting = "testing".equals(System.getProperty("spring.profiles.active"));
+ // check if is DebugTomcat
+ String property = System.getProperty(KylinConfig.KYLIN_CONF);
+ this.isDebugTomcat = property != null && property.contains("examples/test_case_data/sandbox");
}
@Override
public void contextInitialized(ServletContextEvent event) {
- if (!isTesting) {
+ if (!isDebugTomcat) {
super.contextInitialized(event);
}
}
@Override
public void contextDestroyed(ServletContextEvent event) {
- if (!isTesting) {
+ if (!isDebugTomcat) {
super.contextDestroyed(event);
}
}