You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2015/10/26 10:08:14 UTC

[28/45] incubator-kylin git commit: KYLIN-457 Add missing file

KYLIN-457 Add missing file


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/459a41d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/459a41d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/459a41d6

Branch: refs/heads/master
Commit: 459a41d66e5dc5c675b08ae06b50654022ca1b78
Parents: 24e59fc
Author: Yang Li <li...@apache.org>
Authored: Sun Oct 4 20:56:41 2015 +0800
Committer: Yang Li <li...@apache.org>
Committed: Sun Oct 4 20:56:41 2015 +0800

----------------------------------------------------------------------
 .../kylin/rest/util/Log4jConfigListener.java    | 46 ++++++++++++++++++++
 1 file changed, 46 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/459a41d6/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
new file mode 100644
index 0000000..19c76ea
--- /dev/null
+++ b/server/src/main/java/org/apache/kylin/rest/util/Log4jConfigListener.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kylin.rest.util;
+
+import javax.servlet.ServletContextEvent;
+
+public class Log4jConfigListener extends org.springframework.web.util.Log4jConfigListener {
+
+    private boolean isTesting;
+
+    public Log4jConfigListener() {
+        // set by DebugTomcat
+        this.isTesting = "testing".equals(System.getProperty("spring.profiles.active"));
+    }
+
+    @Override
+    public void contextInitialized(ServletContextEvent event) {
+        if (!isTesting) {
+            super.contextInitialized(event);
+        }
+    }
+
+    @Override
+    public void contextDestroyed(ServletContextEvent event) {
+        if (!isTesting) {
+            super.contextDestroyed(event);
+        }
+    }
+
+}