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:12 UTC

[26/45] incubator-kylin git commit: KYLIN-457 Change to kylin-log4j.properties

KYLIN-457 Change to kylin-log4j.properties


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

Branch: refs/heads/master
Commit: f6f67e79991cfa6a09dec6de0cd3ad14f20bdb33
Parents: 7378115
Author: Yang Li <li...@apache.org>
Authored: Sun Oct 4 19:43:23 2015 +0800
Committer: Yang Li <li...@apache.org>
Committed: Sun Oct 4 19:43:23 2015 +0800

----------------------------------------------------------------------
 bin/kylin.sh                                    |  3 +-
 .../src/main/resources/kylin-log4j.properties   | 27 ++++++++++
 common/src/main/resources/kylinlog4j.properties | 27 ----------
 common/src/main/resources/log4j.properties      | 25 ---------
 jdbc/src/main/resources/log4j.properties        | 31 -----------
 monitor/src/main/resources/log4j.properties     | 31 -----------
 .../java/org/apache/kylin/rest/DebugTomcat.java |  2 +
 .../src/main/resources/kylin-log4j.properties   | 55 ++++++++++++++++++++
 server/src/main/resources/log4j.properties      | 55 --------------------
 server/src/main/webapp/WEB-INF/web.xml          |  2 +-
 10 files changed, 87 insertions(+), 171 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/bin/kylin.sh
----------------------------------------------------------------------
diff --git a/bin/kylin.sh b/bin/kylin.sh
index 1334ed1..c11ddf9 100644
--- a/bin/kylin.sh
+++ b/bin/kylin.sh
@@ -63,6 +63,7 @@ then
     hbase ${KYLIN_EXTRA_START_OPTS} \
     -Djava.util.logging.config.file=${tomcat_root}/conf/logging.properties \
     -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
+    -Dlog4j.configuration=kylin-log4j.properties \
     -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true \
     -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true \
     -Djava.endorsed.dirs=${tomcat_root}/endorsed  \
@@ -115,7 +116,7 @@ then
 
     export HBASE_CLASSPATH=${KYLIN_HOME}/lib/*:$hive_dependency:${HBASE_CLASSPATH}
 
-    exec hbase "$@"
+    exec hbase -Dlog4j.configuration=kylin-log4j.properties "$@"
 
 else
     echo "usage: kylin.sh start or kylin.sh stop"

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/common/src/main/resources/kylin-log4j.properties
----------------------------------------------------------------------
diff --git a/common/src/main/resources/kylin-log4j.properties b/common/src/main/resources/kylin-log4j.properties
new file mode 100644
index 0000000..d499713
--- /dev/null
+++ b/common/src/main/resources/kylin-log4j.properties
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+
+# enable this by -Dlog4j.configuration=kylin-log4j.properties
+
+log4j.rootLogger=INFO,stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=L4J [%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%c] - %m%n
+
+#log4j.logger.org.apache.hadoop=ERROR
+log4j.logger.org.apache.kylin=DEBUG

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/common/src/main/resources/kylinlog4j.properties
----------------------------------------------------------------------
diff --git a/common/src/main/resources/kylinlog4j.properties b/common/src/main/resources/kylinlog4j.properties
deleted file mode 100644
index 564f15d..0000000
--- a/common/src/main/resources/kylinlog4j.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# 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.
-#
-
-# use this when conflict with hbase, enable this by -Dlog4j.configuration=kylinlog4j.properties
-
-log4j.rootLogger=INFO,stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=L4J [%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%c] - %m%n
-
-#log4j.logger.org.apache.hadoop=ERROR
-log4j.logger.org.apache.kylin=DEBUG

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/common/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/common/src/main/resources/log4j.properties b/common/src/main/resources/log4j.properties
deleted file mode 100644
index 8c8b685..0000000
--- a/common/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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.
-#
-
-log4j.rootLogger=INFO,stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=L4J [%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%c] - %m%n
-
-#log4j.logger.org.apache.hadoop=ERROR
-log4j.logger.org.apache.kylin=DEBUG

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/jdbc/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/jdbc/src/main/resources/log4j.properties b/jdbc/src/main/resources/log4j.properties
deleted file mode 100644
index 7d5d9a3..0000000
--- a/jdbc/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# 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.
-#
-
-#define appenders
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
-
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.File=kylin_jdbc.log
-log4j.appender.file.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
-log4j.appender.file.Append=true
-
-#overall config
-log4j.rootLogger=DEBUG,stdout,file
-#log4j.logger.org.apache.kylin=DEBUG,stdout,file
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/monitor/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/monitor/src/main/resources/log4j.properties b/monitor/src/main/resources/log4j.properties
deleted file mode 100644
index 6dec581..0000000
--- a/monitor/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# 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.
-#
-
-log4j.rootLogger=INFO,stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=L4J [%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%c] - %m%n
-
-log4j.appender.monitor=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.monitor.layout=org.apache.log4j.PatternLayout
-log4j.appender.monitor.File=${CATALINA_HOME}logs/kylin_monitor.log
-log4j.appender.monitor.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
-log4j.appender.monitor.Append=true
-
-#log4j.logger.org.apache.hadoop=ERROR
-log4j.logger.org.apache.kylin=DEBUG,monitor

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
index 8efbae8..fd072ff 100644
--- a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
+++ b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java
@@ -35,6 +35,8 @@ public class DebugTomcat {
 
     public static void setupDebugEnv() {
         try {
+            System.setProperty("log4j.configuration", "kylin-log4j.properties");
+            
             // test_case_data/sandbox/ contains HDP 2.2 site xmls which is dev sandbox
             ClasspathUtil.addClasspath(new File("../examples/test_case_data/sandbox").getAbsolutePath());
             System.setProperty(KylinConfig.KYLIN_CONF, "../examples/test_case_data/sandbox");

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/server/src/main/resources/kylin-log4j.properties
----------------------------------------------------------------------
diff --git a/server/src/main/resources/kylin-log4j.properties b/server/src/main/resources/kylin-log4j.properties
new file mode 100644
index 0000000..d7dc3bf
--- /dev/null
+++ b/server/src/main/resources/kylin-log4j.properties
@@ -0,0 +1,55 @@
+#
+# 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.
+#
+
+#define appenders
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
+
+log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.File=${catalina.home}/logs/kylin.log
+log4j.appender.file.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
+log4j.appender.file.Append=true
+
+log4j.appender.query=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.query.layout=org.apache.log4j.PatternLayout
+log4j.appender.query.File=${catalina.home}/logs/kylin_query.log
+log4j.appender.query.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
+log4j.appender.query.Append=true
+
+log4j.appender.job=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.job.layout=org.apache.log4j.PatternLayout
+log4j.appender.job.File=${catalina.home}/logs/kylin_job.log
+log4j.appender.job.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
+log4j.appender.job.Append=true
+
+#overall config
+log4j.rootLogger=INFO,stdout,file
+log4j.logger.org.apache.kylin=DEBUG
+log4j.logger.org.springframework=WARN
+
+#query config
+log4j.logger.org.apache.kylin.rest.controller.QueryController=DEBUG, query
+log4j.logger.org.apache.kylin.rest.service.QueryService=DEBUG, query
+log4j.logger.org.apache.kylin.query=DEBUG, query
+log4j.logger.org.apache.kylin.storage=DEBUG, query
+
+#job config
+log4j.logger.org.apache.kylin.rest.controller.JobController=DEBUG, job
+log4j.logger.org.apache.kylin.rest.service.JobService=DEBUG, job
+log4j.logger.org.apache.kylin.job=DEBUG, job

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/server/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/server/src/main/resources/log4j.properties b/server/src/main/resources/log4j.properties
deleted file mode 100644
index d7dc3bf..0000000
--- a/server/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# 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.
-#
-
-#define appenders
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
-
-log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.file.layout=org.apache.log4j.PatternLayout
-log4j.appender.file.File=${catalina.home}/logs/kylin.log
-log4j.appender.file.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
-log4j.appender.file.Append=true
-
-log4j.appender.query=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.query.layout=org.apache.log4j.PatternLayout
-log4j.appender.query.File=${catalina.home}/logs/kylin_query.log
-log4j.appender.query.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
-log4j.appender.query.Append=true
-
-log4j.appender.job=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.job.layout=org.apache.log4j.PatternLayout
-log4j.appender.job.File=${catalina.home}/logs/kylin_job.log
-log4j.appender.job.layout.ConversionPattern=[%t]:[%d{yyyy-MM-dd HH:mm:ss,SSS}][%p][%l] - %m%n
-log4j.appender.job.Append=true
-
-#overall config
-log4j.rootLogger=INFO,stdout,file
-log4j.logger.org.apache.kylin=DEBUG
-log4j.logger.org.springframework=WARN
-
-#query config
-log4j.logger.org.apache.kylin.rest.controller.QueryController=DEBUG, query
-log4j.logger.org.apache.kylin.rest.service.QueryService=DEBUG, query
-log4j.logger.org.apache.kylin.query=DEBUG, query
-log4j.logger.org.apache.kylin.storage=DEBUG, query
-
-#job config
-log4j.logger.org.apache.kylin.rest.controller.JobController=DEBUG, job
-log4j.logger.org.apache.kylin.rest.service.JobService=DEBUG, job
-log4j.logger.org.apache.kylin.job=DEBUG, job

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/f6f67e79/server/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/server/src/main/webapp/WEB-INF/web.xml b/server/src/main/webapp/WEB-INF/web.xml
index 1573c07..ca5f6d9 100644
--- a/server/src/main/webapp/WEB-INF/web.xml
+++ b/server/src/main/webapp/WEB-INF/web.xml
@@ -32,7 +32,7 @@ limitations under the License. See accompanying LICENSE file.
 
     <context-param>
         <param-name>log4jConfigLocation</param-name>
-        <param-value>classpath:log4j.properties</param-value>
+        <param-value>classpath:kylin-log4j.properties</param-value>
     </context-param>
     <context-param>
         <param-name>contextConfigLocation</param-name>