One structured log line per request with django-wide-events

Hi everyone,

I recently came across loggingsucks.com, and it changed how I think about logging in Django. It introduced the idea of “wide-events”. Each request builds up one rich, structured event as it runs and emits it once at the end. That single event tells the whole story: route, status, timing, user, your own domain data, and the error with its traceback if something failed. Since django-structlog does not cover this, i decided to build a small logging package myself.

The project is only in its early stages but the the core functionality is working. Session traceability is planned for the future which turns debugging from “What logs caused the error” to “What requests lead to this error”.

If you are interested or want to try it out yourself, check out the github repo. Any feedback on the idea or the code is very welcome.

Repo: GitHub - moonlitmarigold/django-wide-events: Wide events and the traceback that ended the session · GitHub

This is actually a massive pain point in Django. Trying to stitch together ten different log lines across middleware just to figure out why a request blew up is exhausting, so moving to a single wide event per request makes total sense.

Using structured events right at the end of the lifecycle is way cleaner than traditional log spam. Going to check out the repo—session traceability mapping out what actually led up to an error sounds like a game-changer for debugging production issues.

1 Like