From 7b3e0afb6f7b4941c6a36d1b1b9eb4b154d053ab Mon Sep 17 00:00:00 2001 From: Tim de Beer Date: Wed, 23 Jul 2025 12:20:37 +0200 Subject: [PATCH] :memo: [#639] add Objecttypes logging docs --- docs/manual/logging.rst | 45 ++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/docs/manual/logging.rst b/docs/manual/logging.rst index 2b468744..bda4d9d4 100644 --- a/docs/manual/logging.rst +++ b/docs/manual/logging.rst @@ -3,8 +3,8 @@ Logging ======= -Format ------- +Format Objects +-------------- Objects API emits structured logs (using `structlog `_). A log line can be formatted like this: @@ -25,24 +25,55 @@ A log line can be formatted like this: "level":"info" } +Format Objecttypes +------------------ + +Objecttypes API emits structured logs (using `structlog `_). +A log line can be formatted like this: + +.. code-block:: json + + { + "uuid":"b427ef84-189d-43aa-9efd-7bb2c459e281", + "naam":"test" + "token_identifier":"application-test", + "token_application":"Application (test)", + "event":"objecttype_created", + "user_id":null, + "request_id":"2f9e9a5b-d549-4faa-a411-594aa8a52eee", + "timestamp":"2025-05-19T14:09:20.339166Z", + "logger":"objecttypes.api.v2.views", + "level":"info" + } + Each log line will contain an ``event`` type, a ``timestamp`` and a ``level``. Dependent on your configured ``LOG_LEVEL`` (see :ref:`installation_env_config` for more information), only log lines with of that level or higher will be emitted. -Objects API log events ----------------------- +API log events +-------------- -Below is the list of logging ``event`` types that Objects API can emit. In addition to the mentioned +Below is the list of logging ``event`` types that Objects and Objecttypes API can emit. In addition to the mentioned context variables, these events will also have the **request bound metadata** described in the :ref:`django-structlog documentation `. -API -~~~ +Objects API +~~~~~~~~~~~ * ``objecttypes_api_request_failure``: a request to the Objecttypes API has failed. Additional context: ``exc_info``. * ``search_failed_for_datastore``: attempted to perform ``jsonpath`` search for a backend that does not support this operation. Additional context: ``exc_info``. * ``object_created``: created an ``Object`` via the API. Additional context: ``object_uuid``, ``objecttype_uuid``, ``objecttype_version``, ``token_identifier``, ``token_application``. * ``object_updated``: updated an ``Object`` via the API. Additional context: ``object_uuid``, ``objecttype_uuid``, ``objecttype_version``, ``token_identifier``, ``token_application``. +Objecttypes API +~~~~~~~~~~~~~~~ + +* ``objecttype_created``: created an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``. +* ``objecttype_updated``: updated an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``. +* ``objecttype_deleted``: deleted an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``. +* ``object_version_created``: created an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``. +* ``object_version_updated``: updated an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``. +* ``object_version_deleted``: deleted an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``. + Setup configuration ~~~~~~~~~~~~~~~~~~~