Audit log: best practices?

Hi, I need to create some sort of audit log in order to see who created/updated/deleted a content (including media library). I’m thinking inserting into a custom table in the afterCreate/update… hooks.
My question is what to do about adding stuff to media library. Where can I add a hook to log in that case?

Here is a video from our Youtube that kinda covers something like this:

Alternatively you could build a middleware to catch every request and depending on the content of the request you could execute something as well.

1 Like

Hello guys. I’ve managed to do this according to the video for a content type and I get the info that I want (who made the change, the kind of the request etc.) but I want something more generic for every content type.

I then implemented a simple webhook for every event but the info that I am getting is limited.
“event”: “entry.publish”,
“created_at”: “2021-02-26T15:12:05.730Z”,
“model”: “article”,
“entry”: {
“id”: 5,
“title”: “test”,
“published_at”: “2021-02-26T15:12:05.682Z”,
“created_at”: “2021-02-26T11:00:39.673Z”,
“updated_at”: “2021-02-26T15:12:05.702Z”
“id”: “jCRDKsZ”

How can I implement a mix of the two? Have something work for every content type change and give more data than the webhook?