Back

[SOLVED]How to clean Functions logs

  • 0
  • Self Hosted
Milukun
27 Jun, 2023, 00:33

Deploying the service myself, I execute the official backup script given every day and upload it to my network drive. I found that the dump.sql generated a few days ago was only about 8M, but the dump.sql file generated yesterday was up to 80M I took a brief look at the sql content and it saved a lot of logs, is it possible for appwrite to clean up the logs automatically? If it keeps going like this, the backup will become very big.

TL;DR
The user is asking how to clean Function logs in Appwrite. They received a suggestion to change the value of `_APP_MAINTENANCE_RETENTION_EXECUTION` to a smaller value in the `.env` file. This will delete executions older than the specified number of days. They are also advised to run `docker compose down && docker compose up -d` after making the change. Additionally, the user asks if Appwrite can automatically clean up logs to prevent backups from becoming too large.
Binyamin
27 Jun, 2023, 00:45

Are you referring to this executions logs?

Milukun
27 Jun, 2023, 00:46

yes

Milukun
27 Jun, 2023, 00:47

we got 10k users in 20days , There are many logs generated by users creating accounts, signing in, etc. I think it is sufficient to keep them for 30 days or some other length of time. At the moment it looks like it's always saved?

Binyamin
27 Jun, 2023, 00:48

Change the value of _APP_MAINTENANCE_RETENTION_EXECUTION to small value (other then 1209600 that represent 14 days in seconds) in your .env file As of now every execution older then 14 days will get deleted.

Check here for more details about env variables https://appwrite.io/docs/environment-variables#maintenance

Binyamin
27 Jun, 2023, 00:49

After that run docker compoe down && docker compose up -d

Binyamin
27 Jun, 2023, 00:49

Be aware that if you'll enter 432000 as 5 days worth of seconds, every exeuction older then 5 days will get deleted.

Milukun
27 Jun, 2023, 00:50

Thank you very much for your suggestions!

Milukun
27 Jun, 2023, 00:50

[SOLVED]How to clean Functions logs

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more