Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Tomcat Catalina Logs

Tags:

tomcat

Is there any ways to Clear the catalin.out logs file....? in certain intervals.

if Increasing the logs file more than 5GB than server will be automatically shutdown.

like image 468
chetan Avatar asked Dec 16 '10 06:12

chetan


People also ask

How do I find Tomcat Catalina logs?

By default, the catalina. out file is located in the logs directory under Tomcat's root directory. For example, /opt/netiq/idm/apps/tomcat/logs/catalina.

How do I check Apache Tomcat logs?

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.

What is Tomcat Catalina log?

Each server instance contains its own Catalina. This file is located in the logs directory below the Tomcat root directory. This log is the system's output log, which also consists of standard error messages. These files are saved daily (MM-DD-YYYY) with the date appended to the name of the data.

Where are Tomcat logs on Mac?

Tomcat logs are saved in the Tomcat_Home/logs/catalina. out file. So to live show tomcat logs, you can use tail -f command in the terminal, the tail -f command will display the latest logs in the catalina. out file in terminal.


2 Answers

If you are on linux and you want to clear the log now without restarting tomcat then you can do:

cat /dev/null > /path/to/logfile
like image 70
cherouvim Avatar answered Oct 21 '22 00:10

cherouvim


I have developed .sh file to clear catalina.out file that i will put at location where my project is deployed in tomcat.Now i will execute that file from my java code at certain interval.

Following is the command in my .sh file

echo "" > path to catalina.out file

like image 34
chetan Avatar answered Oct 20 '22 22:10

chetan