I couldn't restart Tomcat webserver. But catalina.out get very big. I have tried delete on test server and created new empty. But Tomcat doesn't write anymore in new catalina.out. How correct delete/create empty new one ?
If you stop tomcat, you can delete all files without any problems. Without stopping, you can remove everything except catalina. out. After stopping the tomcat, you can clear out the contents under Logs folder of tomcat directory.
Catalina. out simply contains everything that is written to Tomcat's "System.
catalina. out is just a redirected output from running server. If your app is logging on console (e.g. by using ConsoleAppender in log4j) you will find your logs there.
You can delete all logs. Those from the current date will not be deletable while Tomcat is running, but that is ok.
If you are using Gnu/Linux or Mac OS X, you can just do:
echo "" > catalina.out
or even shorter:
> catalina.out
for me
echo "" > catalina.out
or
sudo echo "" > catalina.out
didn't work, as the file was created with root/other user privilege
sudo truncate -s 0 catalina.out
worked for me. here -s is for size and I am setting the file size to 0
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