KYLIN-2227 rename kylin-log4j.properties to kylin-tools-log4j.properties and move it to global conf folder
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b8e764d4 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b8e764d4 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b8e764d4 Branch: refs/heads/master Commit: b8e764d434ab12b9fb7b902ac8dea0d6b792dec5 Parents: 3e4e82f Author: Hongbin Ma <mahong...@apache.org> Authored: Wed Nov 23 17:46:04 2016 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Wed Nov 23 18:14:45 2016 +0800 ---------------------------------------------------------------------- build/bin/kylin.sh | 4 +-- build/conf/kylin-tools-log4j.properties | 36 ++++++++++++++++++++ .../src/main/resources/kylin-log4j.properties | 28 --------------- .../gridtable/AggregationCacheSpillTest.java | 1 - kylin-it/pom.xml | 6 ++-- pom.xml | 2 +- .../java/org/apache/kylin/rest/DebugTomcat.java | 2 +- 7 files changed, 43 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/b8e764d4/build/bin/kylin.sh ---------------------------------------------------------------------- diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh index fff6227..b0627ef 100644 --- a/build/bin/kylin.sh +++ b/build/bin/kylin.sh @@ -151,7 +151,7 @@ then elif [ "$1" = "version" ] then - exec hbase -Dlog4j.configuration=kylin-log4j.properties org.apache.kylin.common.KylinVersion + exec hbase -Dlog4j.configuration=file:${KYLIN_HOME}/conf/kylin-tools-log4j.properties org.apache.kylin.common.KylinVersion exit 0 elif [ "$1" = "diag" ] @@ -170,7 +170,7 @@ then then source ${dir}/setenv-tool.sh fi - exec hbase ${KYLIN_EXTRA_START_OPTS} -Dkylin.hive.dependency=${hive_dependency} -Dkylin.hbase.dependency=${hbase_dependency} -Dlog4j.configuration=kylin-log4j.properties "$@" + exec hbase ${KYLIN_EXTRA_START_OPTS} -Dkylin.hive.dependency=${hive_dependency} -Dkylin.hbase.dependency=${hbase_dependency} -Dlog4j.configuration=file:${KYLIN_HOME}/conf/kylin-tools-log4j.properties "$@" else quit "Usage: 'kylin.sh [-v] start' or 'kylin.sh [-v] stop'" http://git-wip-us.apache.org/repos/asf/kylin/blob/b8e764d4/build/conf/kylin-tools-log4j.properties ---------------------------------------------------------------------- diff --git a/build/conf/kylin-tools-log4j.properties b/build/conf/kylin-tools-log4j.properties new file mode 100644 index 0000000..0ba7d2e --- /dev/null +++ b/build/conf/kylin-tools-log4j.properties @@ -0,0 +1,36 @@ +# +# 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. +# + + +# the kylin-tools-log4j.properties is mainly for configuring log properties on kylin tools, including: +# 1. tools launched by kylin.sh script, e.g. DeployCoprocessorCLI +# 2. DebugTomcat +# 3. others +# +# It's called kylin-tools-log4j.properties so that it won't distract users from the other more important log4j config file: kylin-server-log4j.properties +# enable this by -Dlog4j.configuration=kylin-tools-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=%d{ISO8601} %-5p [%t %c{1}:%L]: %m%n + +#log4j.logger.org.apache.hadoop=ERROR +log4j.logger.org.apache.kylin=DEBUG +log4j.logger.org.springframework=WARN http://git-wip-us.apache.org/repos/asf/kylin/blob/b8e764d4/core-common/src/main/resources/kylin-log4j.properties ---------------------------------------------------------------------- diff --git a/core-common/src/main/resources/kylin-log4j.properties b/core-common/src/main/resources/kylin-log4j.properties deleted file mode 100644 index e7201b3..0000000 --- a/core-common/src/main/resources/kylin-log4j.properties +++ /dev/null @@ -1,28 +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. -# - -# 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=%d{ISO8601} %-5p [%t %c{1}:%L]: %m%n - -#log4j.logger.org.apache.hadoop=ERROR -log4j.logger.org.apache.kylin=DEBUG -log4j.logger.org.springframework=WARN http://git-wip-us.apache.org/repos/asf/kylin/blob/b8e764d4/core-cube/src/test/java/org/apache/kylin/gridtable/AggregationCacheSpillTest.java ---------------------------------------------------------------------- diff --git a/core-cube/src/test/java/org/apache/kylin/gridtable/AggregationCacheSpillTest.java b/core-cube/src/test/java/org/apache/kylin/gridtable/AggregationCacheSpillTest.java index 38b8c90..d7787e0 100644 --- a/core-cube/src/test/java/org/apache/kylin/gridtable/AggregationCacheSpillTest.java +++ b/core-cube/src/test/java/org/apache/kylin/gridtable/AggregationCacheSpillTest.java @@ -48,7 +48,6 @@ public class AggregationCacheSpillTest extends LocalFileMetadataTestCase { @BeforeClass public static void beforeClass() { staticCreateTestMetadata(); - System.setProperty("log4j.configuration", "kylin-log4j.properties"); INFO = UnitTestSupport.hllInfo(); final List<GTRecord> data = UnitTestSupport.mockupHllData(INFO, DATA_CARDINALITY); http://git-wip-us.apache.org/repos/asf/kylin/blob/b8e764d4/kylin-it/pom.xml ---------------------------------------------------------------------- diff --git a/kylin-it/pom.xml b/kylin-it/pom.xml index 1cc10fd..148b62b 100644 --- a/kylin-it/pom.xml +++ b/kylin-it/pom.xml @@ -276,7 +276,7 @@ </property> <property> <name>log4j.configuration</name> - <value>kylin-log4j.properties</value> + <value>file:${pom.parent.basedir}/build/conf/kylin-tools-log4j.properties</value> </property> </systemProperties> <argLine>-Xms1G -Xmx2G -XX:PermSize=128M -XX:MaxPermSize=512M</argLine> @@ -300,7 +300,7 @@ <argument>-DuseSandbox=true</argument> <argument>-Dhdp.version=${hdp.version}</argument> <argument>-DfastBuildMode=${fastBuildMode}</argument> - <argument>-Dlog4j.configuration=kylin-log4j.properties</argument> + <argument>-Dlog4j.configuration=file:${pom.parent.basedir}/build/conf/kylin-tools-log4j.properties</argument> <argument>-classpath</argument> <classpath/> <argument>org.apache.kylin.provision.BuildCubeWithEngine</argument> @@ -322,7 +322,7 @@ <argument>-DuseSandbox=true</argument> <argument>-Dhdp.version=${hdp.version}</argument> <argument>-DfastBuildMode=${fastBuildMode}</argument> - <argument>-Dlog4j.configuration=kylin-log4j.properties</argument> + <argument>-Dlog4j.configuration=file:${pom.parent.basedir}/build/conf/kylin-tools-log4j.properties</argument> <argument>-classpath</argument> <classpath/> <argument>org.apache.kylin.provision.BuildCubeWithStream</argument> http://git-wip-us.apache.org/repos/asf/kylin/blob/b8e764d4/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 2d3e04b..9628c0d 100644 --- a/pom.xml +++ b/pom.xml @@ -1097,7 +1097,7 @@ </property> <property> <name>log4j.configuration</name> - <value>kylin-log4j.properties</value> + <value>file:${project.basedir}/build/conf/kylin-tools-log4j.properties</value> </property> </systemProperties> <argLine>-javaagent:${project.build.testOutputDirectory}/jamm.jar ${argLine}</argLine> http://git-wip-us.apache.org/repos/asf/kylin/blob/b8e764d4/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 0f2c500..48cb91b 100644 --- a/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java +++ b/server/src/main/java/org/apache/kylin/rest/DebugTomcat.java @@ -35,7 +35,7 @@ public class DebugTomcat { public static void setupDebugEnv() { try { - System.setProperty("log4j.configuration", "kylin-log4j.properties"); + System.setProperty("log4j.configuration", "file:../build/conf/kylin-tools-log4j.properties"); // test_case_data/sandbox/ contains HDP 2.2 site xmls which is dev sandbox KylinConfig.setSandboxEnvIfPossible();