Logging

Format

Open Product emits structured logs (using structlog). A log line can be formatted like this:

{
    "id": 1,
    "naam": "test",
    "event": "product_created",
    "user_id": null,
    "request_id": "2f9e9a5b-d549-4faa-a411-594aa8a52eee",
    "timestamp": "2025-05-19T14:09:20.339166Z",
    "logger": "openproduct.producten.viewsets.product",
    "level": "info"
}

Each log line will contain an event type, a timestamp and a level. Dependent on your configured LOG_LEVEL (see Environment configuration reference for more information), only log lines with of that level or higher will be emitted.

Open Product log events

Below is the list of logging event types that Open Product can emit. In addition to the mentioned context variables, these events will also have the request bound metadata described in the django-structlog documentation.

API

  • product_created: created a Product via the API. Additional context: id, naam.

  • product_updated: updated a Product via the API. Additional context: id, naam.

  • product_deleted: deleted a Product via the API. Additional context: id, naam.

Third party library events

For more information about log events emitted by third party libraries, refer to the documentation for that particular library