RE: How to delete Liferay Audits?

Vishnu S Kumar, modified 3 Years ago. Regular Member Posts: 131 Join Date: 7/28/17 Recent Posts

We've over 60 million audit logs in the database and we're not using it at all. It's causing problems during DB migrations and all. How to delete these massive logs from DB in an efficieint manner. My questions are:

  1. Is there any bulk delete API for these Audit logs?
  2. Are there any consequences to deleting these logs directly from the DB?
thumbnail
Zsigmond Rab, modified 3 Years ago. Liferay Master Posts: 764 Join Date: 1/5/10 Recent Posts

Hi Vishnu,

There are deleteAuditEvent methods in the AuditEventLocalServiceUtil class that you can use from some script. I think, you can remove old entries periodically, mainly if you don't use them at all.

Zsigmond

Jamie Sammons, modified 2 Years ago. New Member Posts: 10 Join Date: 11/15/21 Recent Posts


Hi !  I see in my portal database the table PORTALAUDIT_Audit with o lot of records.


The most part of them are TRACK records and I am not interesed about this, so, I should like to diseable TRACKING Audit. I need to keep other kind of Audit records.

Please advise me how to configure Audit so that do not generate audit record  for TRACKING..

Many thanks !

Friendly, Alex