directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject [directory-fortress-core] 01/03: Log4j 2.13.3 upgrade
Date Tue, 28 Jul 2020 13:21:12 GMT
This is an automated email from the ASF dual-hosted git repository.

smckinney pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-fortress-core.git

commit 255f7ca8b2202fc21879cf909d27f2b8417e26e5
Author: John Eipe <johne@INLM-JohnE.local>
AuthorDate: Sat Jun 20 15:39:29 2020 +0530

    Log4j 2.13.3 upgrade
---
 config/bootstrap/log4j.xml   | 42 ++++++++++++++++-----------
 config/log4j.xml             | 67 ++++++++++++++++++++++++++------------------
 pom.xml                      | 67 ++++++++++++++++++++++++++++++++------------
 src/test/resources/log4j.xml | 60 +++++++++++++++++++++++----------------
 4 files changed, 151 insertions(+), 85 deletions(-)

diff --git a/config/bootstrap/log4j.xml b/config/bootstrap/log4j.xml
index f6000d8..f9bec85 100755
--- a/config/bootstrap/log4j.xml
+++ b/config/bootstrap/log4j.xml
@@ -17,24 +17,34 @@
  *   specific language governing permissions and limitations
  *   under the License.
 -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration debug="false" xmlns:log4j="http://jakarta.apache.org/log4j/">
+<Configuration>
+    <Appenders>
+        <Console name="console" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d (%-5p) %m%n"/>
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.apache.directory.fortress.core" level="info"/>
+        <Root level="info">
+            <AppenderRef ref="console"/>
+        </Root>
+    </Loggers>
 
-    <appender name="console" class="org.apache.log4j.ConsoleAppender">
-        <layout class="org.apache.log4j.PatternLayout">
-            <param name="ConversionPattern" value="%d (%-5p) %m%n"/>
-        </layout>
-    </appender>
+<!--    <appender name="console" class="org.apache.log4j.ConsoleAppender">-->
+<!--        <layout class="org.apache.log4j.PatternLayout">-->
+<!--            <param name="ConversionPattern" value="%d (%-5p) %m%n"/>-->
+<!--        </layout>-->
+<!--    </appender>-->
 
-    <category name="org.apache.directory.fortress.core" class="org.apache.log4j.Logger"
additivity="false">
-        <priority value="INFO" class="org.apache.log4j.Level"/>
-        <appender-ref ref="console"/>
-    </category>
+<!--    <category name="org.apache.directory.fortress.core" class="org.apache.log4j.Logger"
additivity="false">-->
+<!--        <priority value="INFO" class="org.apache.log4j.Level"/>-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </category>-->
 
 
-    <root>
-        <priority value="INFO" class="org.apache.log4j.Level"/>
-        <appender-ref ref="console"/>
-    </root>
+<!--    <root>-->
+<!--        <priority value="INFO" class="org.apache.log4j.Level"/>-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </root>-->
 
-</log4j:configuration>
+</Configuration>
diff --git a/config/log4j.xml b/config/log4j.xml
index 4cc1b1b..f7361d4 100755
--- a/config/log4j.xml
+++ b/config/log4j.xml
@@ -18,40 +18,53 @@
  *   under the License.
  *
  -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
+<Configuration>
+    <Appenders>
+        <File name="file" fileName="fortress.log" append="true" maxFileSize="10MB" maxBackupIndex="10">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:sss} %-5p %c{1}:%L - %m%n"/>
+        </File>
+        <Console name="console" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:sss} %-5p %c{1}:%L - %m%n"/>
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.apache.directory.fortress.core" level="info"/>
+        <Root level="info">
+            <AppenderRef ref="console"/>
+        </Root>
+    </Loggers>
+</Configuration>
 
-    <appender name="console" class="org.apache.log4j.ConsoleAppender">
-        <layout class="org.apache.log4j.PatternLayout">
-            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:sss} %-5p %c{1}:%L
- %m%n"/>
-        </layout>
-    </appender>
+<!--    <appender name="console" class="org.apache.log4j.ConsoleAppender">-->
+<!--        <layout class="org.apache.log4j.PatternLayout">-->
+<!--            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:sss} %-5p
%c{1}:%L - %m%n"/>-->
+<!--        </layout>-->
+<!--    </appender>-->
 
-    <appender name="file" class="org.apache.log4j.RollingFileAppender">
-        <param name="append" value="true"/>
-        <param name="maxFileSize" value="10MB"/>
-        <param name="maxBackupIndex" value="10"/>
-        <param name="file" value="fortress.log"/>
-        <layout class="org.apache.log4j.PatternLayout">
-            <param name="ConversionPattern"
-                   value="%d{yyyy-MM-dd HH:mm:sss} %-5p %c{1}:%L - %m%n"/>
-        </layout>
-    </appender>
+<!--    <appender name="file" class="org.apache.log4j.RollingFileAppender">-->
+<!--        <param name="append" value="true"/>-->
+<!--        <param name="maxFileSize" value="10MB"/>-->
+<!--        <param name="maxBackupIndex" value="10"/>-->
+<!--        <param name="file" value="fortress.log"/>-->
+<!--        <layout class="org.apache.log4j.PatternLayout">-->
+<!--            <param name="ConversionPattern"-->
+<!--                   value="%d{yyyy-MM-dd HH:mm:sss} %-5p %c{1}:%L - %m%n"/>-->
+<!--        </layout>-->
+<!--    </appender>-->
 
-    <category name="org.apache.directory.fortress.core" class="org.apache.log4j.Logger"
additivity="false">
-        <priority value="INFO" class="org.apache.log4j.Level"/>
-        <appender-ref ref="console"/>
-    </category>
+<!--    <category name="org.apache.directory.fortress.core" class="org.apache.log4j.Logger"
additivity="false">-->
+<!--        <priority value="INFO" class="org.apache.log4j.Level"/>-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </category>-->
 
     <!--category name="org.apache.directory.api" class="org.apache.log4j.Logger" additivity="false">
         <priority value="DEBUG" class="org.apache.log4j.Level"/>
         <appender-ref ref="console"/>
     </category-->
 
-    <root>
-        <priority value="INFO" class="org.apache.log4j.Level"/>
-        <appender-ref ref="console"/>
-        <!--<appender-ref ref="file"/>-->
-    </root>
+<!--    <root>-->
+<!--        <priority value="INFO" class="org.apache.log4j.Level"/>-->
+<!--        <appender-ref ref="console"/>-->
+<!--        &lt;!&ndash;<appender-ref ref="file"/>&ndash;&gt;-->
+<!--    </root>-->
 
-</log4j:configuration>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index c78d2bf..ccff0cd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -121,11 +121,11 @@
     <version.jmeter.core>2.11</version.jmeter.core>
     <version.jmeter.java>2.11</version.jmeter.java>
     <version.junit>4.12</version.junit>
-    <version.log4j>1.2.17</version.log4j>
+    <version.log4j>2.13.3</version.log4j>
     <version.mina.core>2.0.13</version.mina.core>
     <version.opencsv>2.3</version.opencsv>
     <version.slf4j.api>1.7.29</version.slf4j.api>
-    <version.slf4j.log4j12>1.7.21</version.slf4j.log4j12>
+    <version.slf4j.impl>2.13.3</version.slf4j.impl>
     <version.stax2.api>3.1.1</version.stax2.api>
     <version.woodstox.core.asl>4.2.0</version.woodstox.core.asl>
     <version.xml.apis>1.0b2</version.xml.apis>
@@ -254,9 +254,9 @@
     </dependency>
 
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-      <version>${version.slf4j.api}</version>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+      <version>${version.slf4j.impl}</version>
     </dependency>
 
     <dependency>
@@ -481,8 +481,14 @@
     </dependency>
 
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+      <version>${version.log4j}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
       <version>${version.log4j}</version>
       <scope>test</scope>
     </dependency>
@@ -733,7 +739,7 @@
                     <pathelement location="${commons-pool:commons-pool:jar}" />
                     <pathelement location="${net.sf.ehcache:ehcache-core:jar}" />
                     <pathelement location="${org.slf4j:slf4j-api:jar}" />
-                    <pathelement location="${org.slf4j:slf4j-log4j12:jar}" />
+                    <pathelement location="${org.apache.logging.log4j:log4j-slf4j-impl:jar}"
/>
                     <pathelement location="${antlr:antlr:jar}" />
                     <pathelement location="${javax.ws.rs:javax.ws.rs-api:jar}" />
                     <pathelement location="${org.apache.httpcomponents:httpclient:jar}"
/>
@@ -881,8 +887,13 @@
             </executions>
             <dependencies>
               <dependency>
-                <groupId>log4j</groupId>
-                <artifactId>log4j</artifactId>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <version>${version.log4j}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
                 <version>${version.log4j}</version>
               </dependency>
               <dependency>
@@ -935,8 +946,13 @@
             </executions>
             <dependencies>
               <dependency>
-                <groupId>log4j</groupId>
-                <artifactId>log4j</artifactId>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <version>${version.log4j}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
                 <version>${version.log4j}</version>
               </dependency>
               <dependency>
@@ -1047,8 +1063,13 @@
             </executions>
             <dependencies>
               <dependency>
-                <groupId>log4j</groupId>
-                <artifactId>log4j</artifactId>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <version>${version.log4j}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
                 <version>${version.log4j}</version>
               </dependency>
               <dependency>
@@ -1103,8 +1124,13 @@
             </executions>
             <dependencies>
               <dependency>
-                <groupId>log4j</groupId>
-                <artifactId>log4j</artifactId>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <version>${version.log4j}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
                 <version>${version.log4j}</version>
               </dependency>
               <dependency>
@@ -1157,8 +1183,13 @@
             </executions>
             <dependencies>
               <dependency>
-                <groupId>log4j</groupId>
-                <artifactId>log4j</artifactId>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-api</artifactId>
+                <version>${version.log4j}</version>
+              </dependency>
+              <dependency>
+                <groupId>org.apache.logging.log4j</groupId>
+                <artifactId>log4j-core</artifactId>
                 <version>${version.log4j}</version>
               </dependency>
               <dependency>
diff --git a/src/test/resources/log4j.xml b/src/test/resources/log4j.xml
index cc535c6..83a4cba 100755
--- a/src/test/resources/log4j.xml
+++ b/src/test/resources/log4j.xml
@@ -17,23 +17,37 @@
  *   specific language governing permissions and limitations
  *   under the License.
 -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration debug="false" xmlns:log4j="http://jakarta.apache.org/log4j/">
+<Configuration>
+    <Appenders>
+        <File name="file" fileName="fortress.log" append="true">
+            <PatternLayout pattern="%t %-5p %c{2} - %m%n"/>
+        </File>
+        <Console name="console" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d (%-5p) %m%n"/>
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="org.apache.directory.fortress.example" level="debug"/>
+        <Root level="warn">
+            <AppenderRef ref="console"/>
+        </Root>
+    </Loggers>
+</Configuration>
 
 
-    <appender name="file" class="org.apache.log4j.FileAppender">
-        <param name="File" value="fortress.log"/>
-        <param name="Append" value="true"/>
-        <layout class="org.apache.log4j.PatternLayout">
-            <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
-        </layout>
-    </appender>
+<!--    <appender name="file" class="org.apache.log4j.FileAppender">-->
+<!--        <param name="File" value="fortress.log"/>-->
+<!--        <param name="Append" value="true"/>-->
+<!--        <layout class="org.apache.log4j.PatternLayout">-->
+<!--            <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>-->
+<!--        </layout>-->
+<!--    </appender>-->
 
-    <appender name="console" class="org.apache.log4j.ConsoleAppender">
-        <layout class="org.apache.log4j.PatternLayout">
-            <param name="ConversionPattern" value="%d (%-5p) %m%n"/>
-        </layout>
-    </appender>
+<!--    <appender name="console" class="org.apache.log4j.ConsoleAppender">-->
+<!--        <layout class="org.apache.log4j.PatternLayout">-->
+<!--            <param name="ConversionPattern" value="%d (%-5p) %m%n"/>-->
+<!--        </layout>-->
+<!--    </appender>-->
 
     <!-- Uncomment to store REST log statements to file:
         <category name="org.apache.directory.fortress.rest.RestUtils" class="org.apache.log4j.Logger"
additivity="false">
@@ -42,16 +56,14 @@
         </category>
     -->
 
-    <category name="org.apache.directory.fortress.example" class="org.apache.log4j.Logger"
additivity="false">
-        <priority value="DEBUG" class="org.apache.log4j.Level"/>
-        <appender-ref ref="console"/>
-    </category>
+<!--    <category name="org.apache.directory.fortress.example" class="org.apache.log4j.Logger"
additivity="false">-->
+<!--        <priority value="DEBUG" class="org.apache.log4j.Level"/>-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </category>-->
 
-    <root>
-        <priority value="WARN" class="org.apache.log4j.Level"/>
-        <appender-ref ref="console"/>
-    </root>
-
-</log4j:configuration>
+<!--    <root>-->
+<!--        <priority value="WARN" class="org.apache.log4j.Level"/>-->
+<!--        <appender-ref ref="console"/>-->
+<!--    </root>-->
 
 


Mime
View raw message