struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [29/50] [abbrv] struts-examples git commit: WW-4504 - Mark current logging layer as @deprecated and use Log4j2 as default one
Date Thu, 11 Jun 2015 19:17:06 GMT
WW-4504 - Mark current logging layer as @deprecated and use Log4j2 as default one

- Use log4j2 in all provided apps


Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/198c6540
Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/198c6540
Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/198c6540

Branch: refs/heads/master
Commit: 198c6540075587210d37cd343520512dcaaed65f
Parents: 1a072a2
Author: Johannes Geppert <johgep@gmail.com>
Authored: Mon May 25 21:42:08 2015 +0200
Committer: Johannes Geppert <johgep@gmail.com>
Committed: Mon May 25 21:42:08 2015 +0200

----------------------------------------------------------------------
 pom.xml                             | 31 ++++++++++++---------------
 src/main/resources/log4j.properties | 36 --------------------------------
 src/main/resources/log4j2.xml       | 16 ++++++++++++++
 3 files changed, 29 insertions(+), 54 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-examples/blob/198c6540/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9e3e105..0965639 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,6 +47,18 @@
            <version>1.3.5</version>
         </dependency>
 
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>${log4j2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-jcl</artifactId>
+            <version>${log4j2.version}</version>
+        </dependency>
+
     </dependencies>
 
     <build>
@@ -67,30 +79,13 @@
                 <configuration>
                     <stopKey>CTRL+C</stopKey>
                     <stopPort>8999</stopPort>
-                    <systemProperties>
-                        <systemProperty>
-                            <name>log4j.configuration</name>
-                            <value>file:${basedir}/src/main/resources/log4j.properties</value>
-                        </systemProperty>
-                        <systemProperty>
-                            <name>slf4j</name>
-                            <value>false</value>
-                        </systemProperty>
-                    </systemProperties>
-                    <scanIntervalSeconds>10</scanIntervalSeconds>
+                   <scanIntervalSeconds>10</scanIntervalSeconds>
                     <webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
                     <webAppConfig>
                         <contextPath>/struts2-mailreader</contextPath>
                         <descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
                     </webAppConfig>
                 </configuration>
-                <dependencies>
-                    <dependency>
-                        <groupId>log4j</groupId>
-                        <artifactId>log4j</artifactId>
-                        <version>1.2.17</version>
-                    </dependency>
-                </dependencies>
             </plugin>
         </plugins>
     </build>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/198c6540/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
deleted file mode 100644
index e350a2d..0000000
--- a/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
-#
-# The five logging levels used by Log are (in order):
-#
-#   1. DEBUG (the least serious)
-#   2. INFO
-#   3. WARN
-#   4. ERROR
-#   5. FATAL (the most serious)
-
-
-# Set root logger level to WARN and append to stdout
-log4j.rootLogger=INFO, stdout
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-# Pattern to output the caller's file name and line number.
-log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
-
-# Print only messages of level ERROR or above in the package noModule.
-log4j.logger.noModule=FATAL
-
-# OpenSymphony Stuff
-log4j.logger.freemarker=INFO
-log4j.logger.com.opensymphony=INFO
-log4j.logger.com.opensymphony.xwork2.ognl=ERROR
-log4j.logger.org.apache.struts2=WARN
-log4j.logger.org.apache.struts2.components=WARN
-log4j.logger.org.apache.struts2.dispatcher=WARN
-log4j.logger.org.apache.struts2.convention=INFO
-
-# Spring Stuff
-log4j.logger.org.springframework=WARN
-

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/198c6540/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..913b299
--- /dev/null
+++ b/src/main/resources/log4j2.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration>
+    <Appenders>
+        <Console name="STDOUT" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="com.opensymphony.xwork2" level="info"/>
+        <Logger name="org.apache.struts2" level="info"/>
+        <Logger name="org.springframework" level="info"/>
+        <Root level="info">
+            <AppenderRef ref="STDOUT"/>
+        </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file


Mime
View raw message