I have a Tomcat 9 server configured in Eclipse Oxygen. I am trying to use the $CATALINA_BASE/conf/logging.properties
file of my Tomcat install. According to Eclipse Tomcat FAQ, I need to:
1) Copy the logging.properties
file in the server Configuration path folder in Eclipse (here workspace/Servers/Tomcat v9.0 Server at localhost-config
)
2) Put the following VM arguments in the server configuration:
-Djava.util.logging.config.file="<put catalina.base path here>/conf/logging.properties"
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
So first question: aren't these two instructions contradictory? Why would I bother to copy the file in my workspace if I'm going to use the original file in the VM argument?
Anyway, it does not work at all. In logging.properties
I defined a Logger with a FINE level which is not taken into account, whereas it is when I run Tomcat outside of Eclipse. How do I make it work in Eclipse? How can I check which file is loaded?
EDIT
The Eclipse Tomcat FAQ says it's for Tomcat 5.5 but I am unable to find the same doc for Tomcat 9. Besides, the catalina.bat
script confirms these are the two parameters to set for logging :
set LOGGING_CONFIG=-Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
set LOGGING_MANAGER=-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
The Tomcat 9 documentation on logging only says the following on the matter:
This java.util.logging implementation is enabled by providing certain system properties when starting Java. The Apache Tomcat startup scripts do this for you, but if you are using different tools to run Tomcat (such as jsvc, or running Tomcat from within an IDE), you should take care of them by yourself.