Delete event log periodically
-
I am looking for a way to clear the event log periodically. This should work in such a way that all entries older than 14 days are deleted daily. It would also be good if the deletion could be set for certain event groups.
-
Currently the eventlog should be purging events older than 10days https://git.cloudron.io/cloudron/box/-/blob/master/src/cron.js#L101
There is no config option to adjust this though and I am also not sure if that is really useful, given the low amount of events and thus storage they will be using.
Maybe in your case something doesn't work in the cleanup?
-
Hello, my server has only been running for a short time. It seems that the log entries are deleted after 14 days. Thanks for the support.
-
@nebulon sorry for digging up another corpse, but can you confirm that the event log is supposed to be cleared every two weeks? I'm about to hand over a Cloudron to a customer and wanted to see that all the try and error attempts during setup are not in there, but the Event Log shows pretty much everything, dating back almost two years. How can I manually clear the event/mail/cert logs?
-
The current eventlog cleanup time is actually 90 days https://git.cloudron.io/cloudron/box/-/blob/master/src/cron.js#L147
There is otherwise no convenient way to purge the eventlog. Presumably you could just delete all entries in that db table, but that is not really tested. So maybe you can clone the instance, purge that manually and see if it still works.
-
There is an
eventlog
table. Thenotifications
table references entries in that table. Make sure you have a backup and then:mysql -uroot -ppassword -e "DELETE from box.notifications" mysql -uroot -ppassword -e "DELETE from box.eventlog"