in my application I am trying to use hooks to listen to events happening in the NC platform, like uploading/renaming/deleting files etc. I am following the instructions of the manual:
however that seems to break the hole installation after activating the application. The source of the disaster seems to be these two lines:
$app = new Application();
$app->getContainer()->query(‘UserHooks’)->register();
I know that the manuals might be currently outdated and I have a blurry impression that registering services in the container might also be a depreciated method. However I am not sure how I can use hooks in my application. Could anybody shine light into this matter?
Thank you guys. Looking at the examples makes it easy, especially the simpler one.
What I want to do is monitor user activity (from all the users) and export it to a log file in a specific format, so that I can parse it directly with a simple script. I know that the NextCloud log contains everything possible but making a simple custom app is the target!
The admin_audit app writes to the default log, yes.
But you can also manually read the log file, filter entries for app === 'admin_audit' and user === 'target' then you don’t need to write all the code yourself.