Enabling logging of a third party component
Question
In one of codes I am using Jetty. I am using the Jetty jar and imports the Classes from my Java code.
Jetty's default log level is INFO if not configured specifically. We can enable DEBUG mode by code. The logger seems to be a log4j one.
org.mortbay.log.Logger jettyLogger = org.mortbay.log.Log.getLog();
jettyLogger.setDebugEnabled(true);
Assume I haven't added this to the code. And now I want to enable logging by some other method. Can I do this using a log4j configuration?
Solution
Here's the Jetty documentation page on how to use it's logger.
You should just be able to use a standard log4j.properties file if you're using log4j as your logging implementation
OTHER TIPS
Add this to your log4j.xml file
<category name="org.mortbay">
<priority value="debug" />
</category>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow