Reputation: 666
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:
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??
Upvotes: 7
Views: 30026
Reputation: 355
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.
Upvotes: 2
Reputation: 51
You might be overriding the logging.properties file somewhere, So you must check for :
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
3manager.org.apache.juli.AsyncFileHandler.level = FINE
3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
Upvotes: 0
Reputation: 109
Edit conf/logging.properties and change:
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
By
.handlers = 1catalina.org.apache.juli.FileHandler
Upvotes: 6
Reputation: 315
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 .
Upvotes: 1
Reputation: 666
Found answer here: http://helpdesk.objects.com.au/java/how-to-stop-logging-to-catalina-out-with-tomcat-6-0
Upvotes: 3