Foren

How to make catalina.out rotatable

Abhijeet Naukharkar, geändert vor 7 Jahren.

How to make catalina.out rotatable

Junior Member Beiträge: 70 Beitrittsdatum: 27.03.15 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: How to make catalina.out rotatable

Liferay Legend Beiträge: 14915 Beitrittsdatum: 02.09.06 Neueste Beiträge
This is not a Liferay issue, it is a tomcat issue. You'll have to go to them for support.
thumbnail
Jack Bakker, geändert vor 7 Jahren.

RE: How to make catalina.out rotatable

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: How to make catalina.out rotatable

Junior Member Beiträge: 53 Beitrittsdatum: 18.04.13 Neueste Beiträge
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