Forums de discussion
How to make catalina.out rotatable
Abhijeet Naukharkar, modifié il y a 7 années.
How to make catalina.out rotatable
Junior Member Publications: 70 Date d'inscription: 27/03/15 Publications récentes
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.
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.
David H Nebinger, modifié il y a 7 années.
RE: How to make catalina.out rotatable
Liferay Legend Publications: 14914 Date d'inscription: 02/09/06 Publications récentes
This is not a Liferay issue, it is a tomcat issue. You'll have to go to them for support.
Jack Bakker, modifié il y a 7 années.
RE: How to make catalina.out rotatable
Liferay Master Publications: 978 Date d'inscription: 03/01/10 Publications récentes
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
Jaydip Lakhatariya, modifié il y a 7 années.
RE: How to make catalina.out rotatable
Junior Member Publications: 53 Date d'inscription: 18/04/13 Publications récentes
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
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