Skip to content

Commit

Permalink
WW-4492 Add support for Log4J2 as a struts and xwork logging backend
Browse files Browse the repository at this point in the history
 - Use log4j2 in the struts2 blank maven archetype
  • Loading branch information
jogep committed May 1, 2015
1 parent d586fd5 commit 7063f5e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@
</includes>
</fileSet>

<fileSet filtered="false" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>log4j.properties</include>
</includes>
</fileSet>

<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
Expand All @@ -40,6 +33,7 @@
<directory>src/main/resources</directory>
<includes>
<include>**/struts.xml</include>
<include>**/log4j2.xml</include>
<include>**/example.xml</include>
</includes>
</fileSet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -34,16 +35,16 @@
<scope>test</scope>
</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>
Expand Down Expand Up @@ -71,37 +72,34 @@

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<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>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 7063f5e

Please sign in to comment.