Vita Rara: A Life Uncommon

Jetty

Maven Jetty Plugin Logging Woes


Categories: | | |

My logging issues weren't completely over yesterday. I first adopted the "org.apache.commons.logging.impl.SimpleLog" method in the Jetty plugin, but this still spewed far too many lines of logging in my Struts 2 application. The major culprit was FreeMarker. It logs a tremendous amount of data. Far more than I would ever think the average non-FreeMarker developer would ever need.

So, I decided I needed to go the log4j route, so I could control the levels for the various libraries. I copied the dependencies section as explained on the jetty page. This lead to errors when parsing JSP pages and tags. Something in those dependencies introduced something strange into the Jetty runtime environment. After futzing about for a while, and sleeping on it I decided to just delete the dependencies and still try to use log4j. Lo and behold it worked. I started with the log4j.properties file in /src/main/resources created by the Struts 2 Maven archetype as my starting point, and now I have a finely tuned log4j setup.

Maven Jetty Plugin Logging


Categories: | | |

I've gotten Maven, Jetty, Spring, and JPA playing well together! I've ecstatic. Bye, bye JBoss. I don't know that I'll never run JBoss for development again, but I don't think it will be common.

Anyway, upon getting the Jetty Maven Plugin working (mvn jetty:run) it was logging too much debug information. Hitting one page ran out a 10,000 line buffer on my terminal. There was a simple quick fix though. Add a few properties to the plugin configuration in your POM file and voila, reasonable logging.

Syndicate content