The application is running in tomcat
and has it own logger using org.apache.commons.logging.Log and org.apache.commons.logging.LogFactory.
The logs are getting logged at location specified in log4j.properties
file, the location is as follows.
log4j.appender.logger.File=${catalina.base}/logs/applicationlogs.log
The logs are simultaneously added in following file.
/opt/apache-tomcat-8.0.26/logs/catalina.out
How to stop the application logs from getting logged in catalina.out ?
To stop the application to log into catalina.out, you can do it by removing the handler. This can be achieved by editting conf/logging.properties and changing:
A web application running on Apache Tomcat can: Use any logging framework of its choice. Use system logging API, java.util.logging. Use the logging API provided by the Java Servlets specification, javax.servlet.ServletContext.log(...)
Don't forget to restart tomcat. And as suggested in comments, to block writing to catalina.out entirely, set CATALINA_OUT=/dev/null in catalina.sh. Show activity on this post. If your application is using a console appender, then those logs will go to catalina.out. You might want to check that in your application.
If your application is using a console appender, then those logs will go to catalina.out. You might want to check that in your application. To disable logging to catalina.out, you can check discussion: here
You can try to do this:
"$CATALINA_BASE"/bin/catalina.sh
fileCATALINA_OUT="$CATALINA_BASE"/logs/catalina.out
Don't forget to restart tomcat.
And as suggested in comments, to block writing to catalina.out
entirely, set CATALINA_OUT=/dev/null
in catalina.sh
.
I believe the recommended way to "augment" catalina.sh (catalina.bat on Windows) is to:
If your application is using a console appender, then those logs will go to catalina.out. You might want to check that in your application. To disable logging to catalina.out, you can check discussion: here
You will see log file created as per your log configuration.
I'm using tomcat 7.0.50 and I've done following configuration.
To stop the application to log into catalina.out, you can do it by removing the handler.
This can be achieved by editting conf/logging.properties
and changing:
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
to
.handlers = 1catalina.org.apache.juli.FileHandler
Hope this helps. Let me know if I'm missing something.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With