Running Tomcat 6 from within Eclipse 3.5 with log files

Where are my log files?

I configured my Eclipse to be able to run Tomcat 6 as a server from the Servers window. In my (default) settings i configured tomcat to be run from a temp dir and only use the executable from the actual installation (do not modify the tomcat installation). The thing is, by doing this it did no longer generate log files in the {tomcat dir}/logs directory.

Solution

Open your regular {tomcat dir}/conf and copy the logging.properties file to your server settings (Package explorer -> Servers)

Open the server settings (double click on the server in the Servers window, f3, rmb + open action, you like it). In the now opening page you have the “Server Locations” tab (maybe need to unfold it) which shows the “Server path” (=where your log files will be showing up).

In the same window under the “General Information” part you need to copy the filled in “Configuration path”. Then click “Open launch configuration”. (NB: In my installation the filled in Configuration Path = /Servers/Tomcat v6.0 Server at localhost -config which will vary depending on your installation. It is used in the next step!

In the now opened window go to the Arguments tab and append the following to the VM arguments:

-Djava.util.logging.config.file="${resource_loc:/Servers/Tomcat v6.0 Server at localhost -config/logging.properties}" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

By doing this you start tomcat with the custom logging.properties file you designated, and append the required classLoader. (Otherwise you get ClassNotFoundExceptions on the logHandlers)

Restart your tomcat server and rejoice, your log files are now getting saved to the configured Server path\logs directory.

Sources