I have a question regarding tomcat in version 8.0. I have a fast growing catalina.out log file.
Where can I find the setting so that the log only grows to a certain size or maybe I can disable logging into catalina.out at all?
I have a question regarding tomcat in version 8.0. I have a fast growing catalina.out log file.
Where can I find the setting so that the log only grows to a certain size or maybe I can disable logging into catalina.out at all?
I don't recommend disabling logging into catalina.out
since you it will not help you in terms of debugging etc.
Therefore, this could be used to clear the log of catalina.out
file without stopping tomcat with the command below.
sudo cat /dev/null > /opt/tomcat/apache-tomcat-9.0.37/logs/catalina.out
To keep catalina.out
smaller in size, either one of the following ways can be used:
You could use the above Linux
command and add it to a CronScheduler
to run daily/ weekly/ monthly or yearly as preferred.
Use logrotate
tool in Linux
. It is a log managing command-line tool
in Linux. This can rotate the log files under different conditions.
Particularly, we can rotate log files on a fixed duration or if the
file has grown to a certain size. You can click here for more
info on this.