Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to correct delete catalina.out?

Tags:

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 ?

like image 332
user710818 Avatar asked Feb 13 '14 12:02

user710818


People also ask

Can you delete the Catalina out?

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.

What does Catalina out do?

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

How do you get Catalina out on Windows?

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.

Can I delete tomcat log files?

You can delete all logs. Those from the current date will not be deletable while Tomcat is running, but that is ok.


2 Answers

If you are using Gnu/Linux or Mac OS X, you can just do:

echo "" > catalina.out 

or even shorter:

> catalina.out  
like image 181
Sergo Pasoevi Avatar answered Sep 18 '22 15:09

Sergo Pasoevi


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

like image 23
Aqura Avatar answered Sep 21 '22 15:09

Aqura