Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit stdout.log file size when running Apache Tomcat as Windows service?

Is there any way that I could limit the size of the stdout.log file in Apache Tomcat? When running as a service system.out statements go to the stdout file. But I need to have a mechanism where I can control the size of the stdout log file by creating new files after reaching 2GB size or something like that. As of now a new file is created everyday but that is not sufficient.

like image 856
Srinivas Avatar asked Jan 30 '12 21:01

Srinivas


People also ask

Do Apache Tomcat generate log files?

Once Apache Tomcat starts, it will create several log files in the /opt/bitnami/tomcat/logs directory. The main log file is the catalina. out file where you can find error messages. On some platforms, you may need root account privileges to view these files.

What is the default log file for tomcat application?

By default, the Tomcat HTTP Access Logs are stored in the dotserver/tomcat-X.x/logs/ folder within the dotCMS distribution, and the files are named dotcms_access. YYYY-MM-DD. log, where the YYYY-MM-DD in the file name is replaced by the date of the log file.


1 Answers

In Windows you can go to go to Program Files\Apache Software Foundation\Tomcat6.0\bin and run tomcat6w.exe as administrator Under the Java tab, in the Java Options section add the following: -Djava.util.logging.FileHandler.limit=25000000

This will set the default stdout.log file to 25MBs before it rotates to a new log file.

like image 182
J775 Avatar answered Sep 19 '22 05:09

J775