Skip to content

Instantly share code, notes, and snippets.

@alvinlai
Forked from rmetzler/pom.xml
Last active August 29, 2015 14:27
Show Gist options
  • Save alvinlai/d03676184d4cedc8d132 to your computer and use it in GitHub Desktop.
Save alvinlai/d03676184d4cedc8d132 to your computer and use it in GitHub Desktop.
using log4j with the maven-jetty-plugin
<!-- 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