1

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.

pHneutre
  • 1,091
  • 3
  • 12
  • 29
  • Your question is referring to documentation for Tomcat 5.5, which was released in 2004, but you are running Tomcat 9. Here is the [correct logging documentation for Tomcat 9](https://tomcat.apache.org/tomcat-9.0-doc/logging.html). Update or withdraw your question as appropriate. – skomisa Mar 17 '18 at 05:47
  • @skomisa thanks for your answer. I read the Tomcat 9 doc before posting, it is not helping. I edited my post. – pHneutre Mar 17 '18 at 11:03
  • 1
    Does this answer your question? [Tomcat ignores logging.properties when started from Eclipse](https://stackoverflow.com/questions/44198899/tomcat-ignores-logging-properties-when-started-from-eclipse) – bebbo May 23 '20 at 15:40

0 Answers0