Configure JDK Logging in Tomcat

When developing from Eclipse, it is useful to increase the log level to say FINE. In this article, we will see how to do this. I tested this out using TomEE 1.5, but, this should work for Tomcat 7 also.


In the Servers view, double click tomcat server.


Click Open launch configuration.


Click Arguments tab.


Add these two arguments:


Save changes.

To set the log level of your own code, open TOMCAT_INSTALL/conf/ and add this line to the end:

com.mobiarch.test.level = FINE

This will set the log level for the com.mobiarch.test package to FINE.

Restart the server.

Now, your application code using JDK logging will start to show its messages in Eclipse console.

Logger logger = Logger.getLogger(getClass().getName());
logger.fine("Hello world");

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.