Missing feature: Automatic cleaning Job DispatchLogs

Job DispatchLog records increase every time a job is executed, similar to audit logs. Could this eventually saturate the database table?

Does Liferay provide a configuration to automatically remove old logs or limit their growth?

1 Answer

1

Hello @Moozo,

By default, Liferay does not provide any out-of-the-box configuration to delete older logs. However, log rotation can be implemented at the environment level based on your requirements (for example, rotation based on file size, daily rotation, and so on).

For reference, please check the following articles:

https://learn.liferay.com/kb-article/logs-rotation-based-on-size-in-liferay-dxp-7.4

https://learn.liferay.com/kb-article/how-to-rotate-liferay-logs-per-day

Best,
Pooja

Hello @Pooja, but I am talking about DispatcLog which Is a liferay entity and db table

Thanks for your reply. I understand your concern now; however, for deletion (DispatchLog records) from the database, you need to create a Groovy script, as direct deletion from the database is not recommended. DispatchLogLocalServiceUtil() API is available, which consists of delete methods, please refer here: https://github.com/liferay/liferay-portal/blob/master/modules/apps/dispatch/dispatch-api/src/main/java/com/liferay/dispatch/service/DispatchLogLocalServiceUtil.java#L116

Why Liferay doesnt have this feature by default? These records can increase a lot...all Liferay website should have these cleaning process