I have a java web application that I deployed to tomcat. I am using java.util.logging for logging. Here is the logging.properties file.
handlers=java.util.logging.FileHandler,org.apache.juli.FileHandler,java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = INFO
java.util.logging.FileHandler.pattern =%h/DemoWebAppLogs/DemoWebApp%u%g.log
java.util.logging.FileHandler.append=true
java.util.logging.FileHandler.limit = 5000
java.util.logging.FileHandler.count = 5000
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
And this is GitHub link of my code.
When I debug/run the app on eclipse both console and file logging are working fine.
In C:/Users/User DemoWebAppLogs folder is created and DemoWebApp00.log and
DemoWebApp00.log.lck file is created.
But when I deploy the app on tomcat, file logging is not working (console logging is working). Only DemoWebAppLogs folder is created but there are no .log or .lck files.
I exported DempWebApp.war file using eclipse and put that file in CATALINA_HOME/webapps. I'm using tomcat 9.0.55.