Fórum

How to make catalina.out rotatable

Abhijeet Naukharkar, modificado 7 Anos atrás.

How to make catalina.out rotatable

Junior Member Postagens: 70 Data de Entrada: 27/03/15 Postagens Recentes
Hi,
We are facing issue of handling Catalina.out file for liferay because its size exceeds too much.
Even though liferay take backup of catalina.out on daily basis but it doesn't clear catalina.out and its size increasing continuously in GB's.

We did some R&D on this and got one solution to sort out this issue by using linux logrotate utility with copytruncate option.
But copytruncate configuration take very small time slice between copying the file and truncating it, so some logging data might be lost.

By using turning off log level for java.util.logging.ConsoleHandler in tomcat logging.properties, it minimize catalina.out size , but reduce log details.

Is there is any other solution to rotate catalina.out on daily basis or after reach particular size.
thumbnail
David H Nebinger, modificado 7 Anos atrás.

RE: How to make catalina.out rotatable

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
This is not a Liferay issue, it is a tomcat issue. You'll have to go to them for support.
thumbnail
Jack Bakker, modificado 7 Anos atrás.

RE: How to make catalina.out rotatable

Liferay Master Postagens: 978 Data de Entrada: 03/01/10 Postagens Recentes
Hi Abhiieet, perhaps there is something useful in KG's blog: https://web.liferay.com/web/krzysztof.golebiowski/blog/-/blogs/improve-your-liferay-and-tomcat-logging
thumbnail
Jaydip Lakhatariya, modificado 7 Anos atrás.

RE: How to make catalina.out rotatable

Junior Member Postagens: 53 Data de Entrada: 18/04/13 Postagens Recentes
Hi,

If you have linux server then the best way to rotate logs using below steps:

Step1 : Create a new file as below:

/etc/logrotate.d/tomcat

Step2 : Add below content to this file

/opt/liferay-portal/tomcat-7.0.27/logs/catalina.out {
daily
rotate 7
compress
missingok
}

This would automatically rotate your log file. It also have various configuration like you can rotate based on size, time, you can remove past files etc...

Hope this helps !

Regards,
Jaydip