Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not to log to catalina.out

I have the following logging.properties configuration:

1catalina.org.apache.juli.FileHandler.level = FINE
1catalina.org.apache.juli.FileHandler.directory = /mnt/asd/tomcat_logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = /mnt/asd/tomcat_logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = /mnt/asd/tomcat_logs
3manager.org.apache.juli.FileHandler.prefix = manager.

4host-manager.org.apache.juli.FileHandler.level = FINE
4host-manager.org.apache.juli.FileHandler.directory = /mnt/asd/tomcat_logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.

In the folder /mnt/asd/tomcat_logs there are the following files:

  • catalina.2010-08-06.log
  • host-manager.2010-08-06.log
  • localhost.2010-08-06.log
  • manager.2010-08-06.log

But in the /etc/tomcat/tomcat/log folder there is also catalina.out file. How can I change the path of the file to /mnt/asd/tomcat_logs??

like image 819
tzulberti Avatar asked Aug 06 '10 14:08

tzulberti


People also ask

What does Catalina out do?

Catalina. out simply contains everything that is written to Tomcat's "System.

Where are tomcat logs stored?

The main Apache Tomcat configuration file is at /opt/bitnami/tomcat/conf/server. xml. Once Apache Tomcat starts, it will create several log files in the /opt/bitnami/tomcat/logs directory.


4 Answers

Edit conf/logging.properties and change:

.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

By

.handlers = 1catalina.org.apache.juli.FileHandler
like image 120
Monkiki Avatar answered Oct 04 '22 16:10

Monkiki


Found answer here: http://helpdesk.objects.com.au/java/how-to-stop-logging-to-catalina-out-with-tomcat-6-0

like image 36
tzulberti Avatar answered Oct 04 '22 14:10

tzulberti


Above approaches are correct, but rather than changing existing sh files, please create new "$CATALINA_BASE/bin/setenv.sh" file and add this entry:

export CATALINA_OUT="/new/path/to/catalina.out"

Do not forget to chmod +x "$CATALINA_BASE/bin/setenv.sh".

For Windows use its setenv.bat counterpart.

like image 37
David Vít Avatar answered Oct 04 '22 15:10

David Vít


you must edit "$CATALINA_BASE"/bin/catalina.sh file and find CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out and replace with new path .

restart tomcta and enjoy it .

like image 28
Kobra Ghahremani Avatar answered Oct 04 '22 15:10

Kobra Ghahremani