留言板

How to make catalina.out rotatable

Abhijeet Naukharkar,修改在7 年前。

How to make catalina.out rotatable

Junior Member 帖子: 70 加入日期: 15-3-27 最近的帖子
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,修改在7 年前。

RE: How to make catalina.out rotatable

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
This is not a Liferay issue, it is a tomcat issue. You'll have to go to them for support.
thumbnail
Jack Bakker,修改在7 年前。

RE: How to make catalina.out rotatable

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
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,修改在7 年前。

RE: How to make catalina.out rotatable

Junior Member 帖子: 53 加入日期: 13-4-18 最近的帖子
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