Skip to content

Commit 93178ba

Browse files
authored
Merge pull request #642 from maykinmedia/feature/add-objecttypes-logging-docs
📝 [#639] add Objecttypes logging docs
2 parents fe7735e + 7b3e0af commit 93178ba

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

docs/manual/logging.rst

Lines changed: 38 additions & 7 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
33-
----------------------
53+
API log events
54+
--------------
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
39-
~~~
59+
Objects API
60+
~~~~~~~~~~~
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+
* ``objecttype_created``: created an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``.
71+
* ``objecttype_updated``: updated an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``.
72+
* ``objecttype_deleted``: deleted an ``Objecttype`` via the API. Additional context: ``uuid``, ``naam``, ``token_identifier``, ``token_application``.
73+
* ``object_version_created``: created an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``.
74+
* ``object_version_updated``: updated an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``.
75+
* ``object_version_deleted``: deleted an ``Object_version`` via the API. Additional context: ``version``, ``objecttype_uuid``, ``token_identifier``, ``token_application``.
76+
4677
Setup configuration
4778
~~~~~~~~~~~~~~~~~~~
4879

0 commit comments

Comments
 (0)