Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Trivial
-
Resolution: Duplicate
-
Affects Version/s: 1.0-beta-1
-
Fix Version/s: 1.0
-
Component/s: None
-
Labels:None
-
Environment:any
-
Patch Submitted:Yes
-
Number of attachments :
Description
As I hate the juli logging that tomcat developers insist on using, I replace the logger to log4j as per tomcat documentation as soon as I install new one.
But maven tomcat plugin uses embedded tomcat which still makes it possible to force log4j over juli. Except a change is needed in the source.
According to the discussion here [1] System.properties should be set as soon as possible preferable before loading any tomcat class to prevent being too late for logger initialization. Therefore the attached patch is needed which merely move setupSystemProperties up before any tomcat class construction.
Also a tweak in the plugin configuration is needed as below:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<path>/</path>
<systemProperties>
<java.util.logging.manager>org.apache.juli.ClassLoaderLogManager</java.util.logging.manager>
<log4j.configuration>file://${basedir}/src/main/webapp/WEB-INF/log4j.xml</log4j.configuration>
</systemProperties>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>juli</artifactId>
<classifier>log4j</classifier>
<version>6.0.26</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>juli-adapters</artifactId>
<version>6.0.26</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
</dependency>
</dependencies>
</plugin>
regards,
Hasan Ceylan
Attachments
Issue Links
| This issue duplicates: | ||||
| MTOMCAT-37 | system properties not set when using a server.xml |
|
|
|
linked to
MTOMCAT-37?Have you tried with current trunk ?
MTOMCAT-37? Have you tried with current trunk ?