Created
December 9, 2010 12:53
-
-
Save rmetzler/734680 to your computer and use it in GitHub Desktop.
using log4j with the maven-jetty-plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Run the application using "mvn jetty:run" --> | |
<plugin> | |
<groupId>org.mortbay.jetty</groupId> | |
<artifactId>maven-jetty-plugin</artifactId> | |
<version>6.1.9</version> | |
<configuration> | |
<scanIntervalSeconds>5</scanIntervalSeconds> | |
<contextPath>/</contextPath> | |
<connectors> | |
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector"> | |
<port>8088</port> | |
<maxIdleTime>60000</maxIdleTime> | |
</connector> | |
</connectors> | |
<webApp>${basedir}/target/classes</webApp> | |
<!-- Log to the console. --> | |
<requestLog implementation="org.mortbay.jetty.NCSARequestLog"> | |
<filename>target/yyyy_mm_dd.request.log</filename> | |
<retainDays>90</retainDays> | |
<append>true</append> | |
<extended>true</extended> | |
<logTimeZone>GMT</logTimeZone> | |
</requestLog> | |
<!-- this is where the log4j.properties file should be found --> | |
<systemProperties> | |
<systemProperty> | |
<name>log4j.configuration</name> | |
<value>file:./target/classes/log4j.properties</value> | |
</systemProperty> | |
</systemProperties> | |
</configuration> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
setting up the log4j.properties file avoids the dreaded log4j ERROS: "No appenders could be found for logger"
You can use systemProperties instead of -Dlog4j.configuration=file:./target/classes/log4j.properties