views:

495

answers:

3

I have a web application running under Tomcat.

Logging for various features is implemented using java.util.logging.

When running tomcat via startup.bat the logging files are created and record the logging as expected.

When running as a windows service using the same war file the output from logging is virtually absent. There is some ( Barely any ) log output in stdout.log and stderr.log but not what is expected.

Does this sound familiar to anyone? what steps did you take to correct it?

Regards

A: 

stdout and stderr log files should have been created in the logs directory of your Tomcat installation.

To configure logging use the "Configure Tomcat" application. You can set the error level and the location of the log files there.

kgiannakakis
A: 

Make sure that the Tomcat environment is the same in both cases. Check the paths and settings in the Tomcat service editor. Don't use the standard Windows properties dialog for services but start tomcat.exe with //ES//name where name is the name of the service.

Aaron Digulla
A: 

As it turns out this is a configuration problem.

When started from the startup.bat tomcat will reference the logging.properties in the conf directory.

When started as a service the jdk/jre/lib logging.properties comes into play.

When running as a windows service, all console output is redirected to stdout.log in the tomcat logs directory .

Attempts to capture logging in custom files with custom logging.properties files have so far failed.

FacilityDerek
-1 for "When started as a service the jdk/jre/lib logging.properties comes into play." Use the "Monitor Tomcat" application to configure logging, when running Tomcat as Windows Service.
kgiannakakis