Search code examples
javawindowstomcatloggingservice

Tomcat Logging while running as a windows service


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


Solution

  • 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.