You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2018/03/06 02:46:15 UTC

[incubator-pulsar] branch master updated: Use log4j2.xml in buildtools and specify the log4j configuration in surefire plugin (#1344)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new a6e65eb  Use log4j2.xml in buildtools and specify the log4j configuration in surefire plugin (#1344)
a6e65eb is described below

commit a6e65eb28414164fa01029685bc7240f93d9be13
Author: Sijie Guo <gu...@gmail.com>
AuthorDate: Mon Mar 5 18:46:13 2018 -0800

    Use log4j2.xml in buildtools and specify the log4j configuration in surefire plugin (#1344)
    
    * Use log4j2.xml in buildtools and specify the log4j configuration in surefire plugin
    
    It seems there is SAXProcess exception when using yaml file when the yaml file is in a jar. log4j2 misinterprets yml as an xml file.
    
    Change it to use xml file and specify that in the surefire plugin
    
    * Add class and linenumber
---
 buildtools/src/main/resources/log4j2.xml | 34 ++++++++++++++++++++++++++
 buildtools/src/main/resources/log4j2.yml | 41 --------------------------------
 pom.xml                                  |  1 +
 3 files changed, 35 insertions(+), 41 deletions(-)

diff --git a/buildtools/src/main/resources/log4j2.xml b/buildtools/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..e732953
--- /dev/null
+++ b/buildtools/src/main/resources/log4j2.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<Configuration status="INFO">
+    <Appenders>
+        <Console name="Console" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t:%C@%L] %-5level %logger{36} - %msg%n" />
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Root level="warn">
+            <AppenderRef ref="Console" />
+        </Root>
+        <Logger name="org.apache.pulsar" level="info"/>
+    </Loggers>
+</Configuration>
diff --git a/buildtools/src/main/resources/log4j2.yml b/buildtools/src/main/resources/log4j2.yml
deleted file mode 100644
index 94ad627..0000000
--- a/buildtools/src/main/resources/log4j2.yml
+++ /dev/null
@@ -1,41 +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.
-#
-
-Configuration:
-  name: test
-
-  Appenders:
-
-    # Console
-    Console:
-      name: Console
-      target: SYSTEM_OUT
-      PatternLayout:
-        Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
-
-  Loggers:
-
-    Root:
-      level: warn
-      AppenderRef:
-        - ref: Console
-
-    Logger:
-      name: org.apache.pulsar
-      level: info
diff --git a/pom.xml b/pom.xml
index 2b213bd..ccaa133 100644
--- a/pom.xml
+++ b/pom.xml
@@ -783,6 +783,7 @@ flexible messaging model and an intuitive client API.</description>
         <configuration>
           <argLine> -Xmx2G -XX:MaxDirectMemorySize=8G
             -Dio.netty.leakDetectionLevel=advanced
+            -Dlog4j.configurationFile=log4j2.xml
           </argLine>
           <reuseForks>false</reuseForks>
           <forkCount>1</forkCount>

-- 
To stop receiving notification emails like this one, please contact
mmerli@apache.org.