Audit log table cleanup

I would like to have a new feature on Retool to allow auto-cleanup of the audit log table with data older than 90 days or so. I have a situation where a deployment is being heavily used and it's generating too many entries in the audit logs (50 GB), and this is taking forever to clean up. Could you please consider adding a background process to perform this task? Thanks!

Hello @Marcus_Santos!

Are you self hosted or on the cloud?

I can definitely make a feature request for such a tool to be native to Retool.

For work arounds in the short term, if you are self hosted, there are a number of tools that you can use to clean up that Postgres table containing the logs.

For your use case where you want to clear out logs that are older than 90 days you could use SQL native tools combined with automated jobs to accomplish the following steps.

  1. Partition table by month using pg_partman
  2. Schedule a weekly cron job(could potentially use a Workflow for this!) to:
  3. Drop old partitions > 3 months
  4. Call pg_repack if necessary, to reclaim data
  5. Export logs > 6 months to cold storage (optional)

Hi Jack,

Yes, it's a self-hosted deployment on Google Cloud, using a managed Cloud SQL instance. The client is already performing these workarounds, but it's asking for a native feature. Let me know when you create the feature request and when it's planned to be released.

Thank you!