struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject struts git commit: WW-4492 Add support for Log4J2 as a struts and xwork logging backend
Date Fri, 01 May 2015 11:10:28 GMT
Repository: struts
Updated Branches:
  refs/heads/develop f150c9f29 -> 45d8f37c7


 WW-4492 Add support for Log4J2 as a struts and xwork logging backend

 - Use log4j2 in the convention plugin based maven archetype
 - Escape base directory property in angularjs maven archetype pom.xml


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

Branch: refs/heads/develop
Commit: 45d8f37c773ba74f5235c70b6f5701d065442e97
Parents: f150c9f
Author: Johannes Geppert <johgep@gmail.com>
Authored: Fri May 1 13:10:18 2015 +0200
Committer: Johannes Geppert <johgep@gmail.com>
Committed: Fri May 1 13:10:18 2015 +0200

----------------------------------------------------------------------
 .../main/resources/archetype-resources/pom.xml  |  4 +--
 .../main/resources/archetype-resources/pom.xml  | 34 +++++++-------------
 .../src/main/resources/log4j.properties         | 29 -----------------
 .../src/main/resources/log4j2.xml               | 16 +++++++++
 4 files changed, 30 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/45d8f37c/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
index 3872a06..b008115 100644
--- a/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
+++ b/archetypes/struts2-archetype-angularjs/src/main/resources/archetype-resources/pom.xml
@@ -108,9 +108,9 @@
                         </systemProperty>
                     </systemProperties>
                     <scanIntervalSeconds>10</scanIntervalSeconds>
-                    <webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
+                    <webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
                     <webAppConfig>
-                        <descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
+                        <descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
                     </webAppConfig>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/struts/blob/45d8f37c/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
b/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
index b1f481a..ebfb0de 100644
--- a/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
+++ b/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/pom.xml
@@ -10,6 +10,7 @@
 
     <properties>
         <struts2.version>${project.version}</struts2.version>
+        <log4j2.version>${log4j2.version}</log4j2.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
 
@@ -41,15 +42,14 @@
         </dependency>
 
         <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>1.1.3</version>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <version>\${log4j2.version}</version>
         </dependency>
-
         <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>1.2.17</version>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>\${log4j2.version}</version>
         </dependency>
 
         <dependency>
@@ -79,6 +79,7 @@
         <plugins>
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.3</version>
                 <configuration>
                     <encoding>UTF-8</encoding>
                     <source>1.5</source>
@@ -88,35 +89,24 @@
             <plugin>
                 <groupId>org.mortbay.jetty</groupId>
                 <artifactId>jetty-maven-plugin</artifactId>
-                <version>8.1.7.v20120910</version>
+                <version>8.1.16.v20140903</version>
                 <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>
+                            <name>xwork.loggerFactory</name>
+                            <value>com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory</value>
                         </systemProperty>
                     </systemProperties>
                     <scanIntervalSeconds>10</scanIntervalSeconds>
                     <webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
                     <webAppConfig>
-                        <contextPath>/\${artifactId}</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>
 </project>

http://git-wip-us.apache.org/repos/asf/struts/blob/45d8f37c/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
b/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
deleted file mode 100644
index a29a304..0000000
--- a/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,29 +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=WARN, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-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=ERROR
-
-# OpenSymphony Stuff
-log4j.logger.com.opensymphony=INFO
-
-# Struts2 Stuff
-log4j.logger.org.apache.struts2=INFO

http://git-wip-us.apache.org/repos/asf/struts/blob/45d8f37c/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j2.xml
b/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..6d27d12
--- /dev/null
+++ b/archetypes/struts2-archetype-convention/src/main/resources/archetype-resources/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="\${groupId}" level="debug"/>
+        <Root level="warn">
+            <AppenderRef ref="STDOUT"/>
+        </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file


Mime
View raw message