Tomcat has two applications: apps and zaz . The Tomcat \ lib folder contains the log4j.properties file, which is common for both applications. For the first application, the path for outputting logs is configured as follows (in the log4j.properties 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 \ cust.properties, and in the file apps \ Web-inf \ web.xml has the following lines:
<context-param> <param-name>propsFile</param-name> <param-value>com\comp\cust.properties</param-value> </context-param>
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 cust.properties file is completely empty!
Moreover, if you transfer the entire contents of the log4j.properties file to the cust.properties file, the logs are written to the /usr/local/tomcat/logs/zaz/zaz.log file.
How does this setting (
propsFile ) affect how
Try to remove $ CATALINA_BASE / conf / logging.properties 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.