tomcat – Strange behavior of log4j:<context-param> interferes with log4j


Tomcat has two applications: apps and zaz . The Tomcat \ lib folder contains the file, which is common for both applications. For the first application, the path for outputting logs is configured as follows (in the file):


and for the second it is similar:


And what is the oddity in the apps folder, there is a file apps \ Web-inf \ classes \ com \ comp \, and in the file apps \ Web-inf \ web.xml has the following lines:


Moreover, if these lines are commented out, then logs are written to the /usr/local/tomcat/logs/zaz/zaz.log file, and if not commented out, then this file is created, but the logs are not written to it. And this even happens when the file is completely empty!


Moreover, if you transfer the entire contents of the file to the file, the logs are written to the /usr/local/tomcat/logs/zaz/zaz.log file.

How does this setting ( propsFile ) affect how propsFile works?


Try to remove $ CATALINA_BASE / conf / to prevent java.util.logging from generating zero-sized logs. This step is one of the recommendations in the Using Log4j chapter of the Tomcat manual (ref)

In general, Java has a big problem with spawning loggers (ref) , so there may be conflicts in your applications and Tomcat settings.

As another option, make sure that there is space on the disk at the time of logging.

Scroll to Top