diff --git a/developer_manual/basics/logging.rst b/developer_manual/basics/logging.rst index db9259279..490581cb1 100644 --- a/developer_manual/basics/logging.rst +++ b/developer_manual/basics/logging.rst @@ -41,3 +41,25 @@ the app ID. use function OCP\Log\logger; logger('calendar')->warning('look, no dependency injection'); + +Admin audit logging +------------------- + +If you want to log things less for system administration but for compliance reasons, e.g. who accessed which file, +who changed the password of an item or made it public, the +`admin audit log `_ +is the correct place. + +You can easily add a log by simply emitting an ``OCP\Log\Audit\CriticalActionPerformedEvent`` event: + +.. code-block:: php + + 'My App ID'] + ); + $dispatcher->dispatchTyped($event);