Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 deletions docs/manual/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Logging
=======

Format
------
Format Objects
--------------

Objects API emits structured logs (using `structlog <https://www.structlog.org/en/stable/>`_).
A log line can be formatted like this:
Expand All @@ -25,24 +25,55 @@ A log line can be formatted like this:
"level":"info"
}

Format Objecttypes
------------------

Objecttypes API emits structured logs (using `structlog <https://www.structlog.org/en/stable/>`_).
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 <request_events>`.

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
~~~~~~~~~~~~~~~~~~~

Expand Down