Rank 1: Thread
Hello, what are the ways of identifying, when and by who, a collection has been deleted ?
Votes
3
Replies
22
Participants
Unknown
Messages
23
Rank 1: Thread
Hello, what are the ways of identifying, when and by who, a collection has been deleted ?
Hi, when it is created/updated, you can see it in activity tab of collection.
Rank 1: Thread
Thank you, but how about deleted ?
Hmm not sure about deleted Let me confirm once and get back to you
Rank 1: Thread
Thankies
Rank 1: Thread

Rank 3: Container
Hello @Victor1337 , you can use appwrite events and trigger some function.
databases.*.collections.*.delete
Rank 3: Container
if it is a specific collection:
databases.*.collections.my-collection.delete
here is a list of all events:
https://appwrite.io/docs/events
Rank 3: Container
@Victor1337 if you can write a little more about your use case, we can come up with a pretty cool solution
Rank 1: Thread
In the meantime I connected to mariaDb underlying container, and found some info in the audit table. Does that incorporate all events ? Of type collection delete ?
Rank 3: Container
I can't tell you how the internals of appwrite work, I'll leave it to someone with more experience
Admin
unfortunately, the audit data is also deleted when the collection is deleted. You could create a feature request to somehow retain the audit data, though.
Admin
nice! but that probably doesn't tell you who did it, right? 🧐
Admin
you could also see if there's any HTTP Access logs that might give you some info too. if it's not enabled, you could try to enable them (on traefik)
Rank 1: Thread
@Steven , I did manage to track that down, but the process was painful. And I don't feel is right, the reason I managed was based on time event logs from docker, annexed with ip. But not provided by appwrite structure.
Admin
nice!
Rank 1: Thread
Also collection.delete is saved in audit table. Going trough the process seams to stay there, should it get deleted ?
Rank 1: Thread
Are there some better logs on the roadmap ?
Admin
it's not something worked on at the moment, if you want to see better audit logs for deleted collections, please make sure to create an issue
Rank 1: Thread
@Steven Yes sir, will crate a issue, this is how I found events of sort. But not the friendliest approach. Thankies
Admin
that's interesting...that should have been deleted 😅 This is the _<number>_audit table, right?
Rank 1: Thread
Right
Rank 1: Thread
Made this little guy -> https://github.com/appwrite/appwrite/issues/5262