0

Apache Tomcat 9 is logging in multiple log files, I have set up tomcat 9 which is working fine but I noticed that it's created Catalina.out and similar log files in two folders.

  1. Tomcat 9/bin/log/catalina.out
  2. Tomcat 9/log/catalina.out

It's logging in both files switching one by one after some hours and someday not exact time but it's not duplicate logs which is good. I also checked the logger.properties file for the configuration but didn't found the issue. Anyone else facing the same issue? any suggestions.

Atif Hussain
  • 880
  • 12
  • 19
  • 2
    `catalina.out` is not actually created by Tomcat, but by startup scripts, which redirect stdout and stderr to that file. How do you start Tomcat? The `catalina.sh` script uses a default of `$CATALINA_BASE/logs/catalina.out` (`logs` not `log`), hence you must have changed the default configuration. – Piotr P. Karwasz Jun 07 '21 at 07:02
  • we start server using startup.sh script mentioned in /bin folder. – Atif Hussain Jun 07 '21 at 08:32
  • Can you add to the question the contents of `bin/setenv.sh` if this file exists? My guess is: it contains `CATALINA_OUT=log/catalina.out`. – Piotr P. Karwasz Jun 07 '21 at 09:33
  • cat setenv.sh CATALINA_OPTS="$CATALINA_OPTS -Ddd.profiling.enabled=true -Ddd.logs.injection=true -Ddd.trace.sample.rate=1 -Ddd.jmxfetch.enabled=true -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.rmi.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=32.34.43.34 -Xms2048m -Xmx7168m -XX:PermSize=256m -XX:MaxPermSize=512m" JAVA_OPTS="$JAVA_OPTS -javaagent:/root/appoptics-agent.jar=config=/root/javaagent.json" – Atif Hussain Jun 15 '21 at 09:41
  • it does not contain CATALINA_OUT. – Atif Hussain Jun 15 '21 at 09:42

0 Answers0