Create Administrative Hooks


I have a case in which I need to make something similar to the app activity but the difference that I’m not concerned in GUI for the app and I need the app to listen to the server not on a user level, but more like administrative level, meaning to monitor all activities that are made to the files by all users 24 hours, whether they are signed in or not.

The problem is, I followed the code of the app activity but I don’t know how the code gets the username, at the line I don’t know how the use id is acquired, it appears the user that is signed in is the one which passes the user id.

in a nutshell for an application that monitors all the users activities to the files all the time, how to register hooks for all users and files hooks for every user?

Thanks in advance

This sounds exactly like what the admin audit app does. Have you tried that instead?

1 Like

Thanks for the reply
The audit app writes the outputs on the file nextcloud.log at the path /var/snap/nextcloud/common/nextcloud/data ,right?

another question though, where can I find the code for this app specifically?

Yes data/nextcloud.log

The code is in apps/admin_audit in our main repository:

thanks for the answer