Skip to content

Commit 5ad96dc

Browse files
committed
📝 [#639] add Objecttypes logging docs
1 parent ef20e68 commit 5ad96dc

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

docs/manual/logging.rst

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Logging
44
=======
55

6-
Format
7-
------
6+
Format Objects
7+
--------------
88

99
Objects API emits structured logs (using `structlog <https://www.structlog.org/en/stable/>`_).
1010
A log line can be formatted like this:
@@ -25,24 +25,55 @@ A log line can be formatted like this:
2525
"level":"info"
2626
}
2727
28+
Format Objecttypes
29+
------------------
30+
31+
Objecttypes API emits structured logs (using `structlog <https://www.structlog.org/en/stable/>`_).
32+
A log line can be formatted like this:
33+
34+
.. code-block:: json
35+
36+
{
37+
"uuid":"b427ef84-189d-43aa-9efd-7bb2c459e281",
38+
"naam":"test"
39+
"token_identifier":"application-test",
40+
"token_application":"Application (test)",
41+
"event":"objecttype_created",
42+
"user_id":null,
43+
"request_id":"2f9e9a5b-d549-4faa-a411-594aa8a52eee",
44+
"timestamp":"2025-05-19T14:09:20.339166Z",
45+
"logger":"objecttypes.api.v2.views",
46+
"level":"info"
47+
}
48+
2849
Each log line will contain an ``event`` type, a ``timestamp`` and a ``level``.
2950
Dependent on your configured ``LOG_LEVEL`` (see :ref:`installation_env_config` for more information),
3051
only log lines with of that level or higher will be emitted.
3152

32-
Objects API log events
53+
API log events
3354
----------------------
3455

35-
Below is the list of logging ``event`` types that Objects API can emit. In addition to the mentioned
56+
Below is the list of logging ``event`` types that Objects and Objecttypes API can emit. In addition to the mentioned
3657
context variables, these events will also have the **request bound metadata** described in the :ref:`django-structlog documentation <request_events>`.
3758

38-
API
59+
Objects API
3960
~~~
4061

4162
* ``objecttypes_api_request_failure``: a request to the Objecttypes API has failed. Additional context: ``exc_info``.
4263
* ``search_failed_for_datastore``: attempted to perform ``jsonpath`` search for a backend that does not support this operation. Additional context: ``exc_info``.
4364
* ``object_created``: created an ``Object`` via the API. Additional context: ``object_uuid``, ``objecttype_uuid``, ``objecttype_version``, ``token_identifier``, ``token_application``.
4465
* ``object_updated``: updated an ``Object`` via the API. Additional context: ``object_uuid``, ``objecttype_uuid``, ``objecttype_version``, ``token_identifier``, ``token_application``.
4566

67+
Objecttypes API
68+
~~~
69+
70+
* ``objecttypes_api_request_failure``: a request to the Objecttypes API has failed. Additional context: ``exc_info``.
71+
* ``search_failed_for_datastore``: attempted to perform ``jsonpath`` search for a backend that does not support this operation. Additional context: ``exc_info``.
72+
* ``objecttype_created``: created an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``.
73+
* ``objecttype_updated``: updated an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``.
74+
* ``objecttype_deleted``: deleted an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``.
75+
76+
4677
Setup configuration
4778
~~~~~~~~~~~~~~~~~~~
4879

0 commit comments

Comments
 (0)