I love Jetty. It’s starts in 3 seconds, it’s a coupla jars, its config file is sensible to me, and it’s Australian. But I’ve hit issues with Jetty and logging before (specifically commons logging)… so I’m going to blog about this before I forget it (and so I can Google for it later - cause I keep forgetting the fix).
Here’s the scenario, you’ve installed your webapp on Jetty and you’re wondering why your commons logging stuff is stuck at INFO level. You’ve tried copying commons-logging.properties and log4j.properties files all over the place, but no joy.
Turns out that Jetty implements its own commons logging factory, so you might not be having any luck overriding it. It also turns out that your options are actually well documented on the Jetty site, but the short answer, to save you some digging, is that it’s all very configurable.
One thing I’ve just done is use the specific -D option for the log factory (per the example on their site). So you end up with a start line of:
java -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -jar start.jar
… and all my DEBUG logs started coming back. Love that Jetty goodness.