bobbui/json-logging-python

Can it be made possible to set the User also via a Header if not present?

Ben-Bock opened this issue · 1 comments

Hi, great package! Could it made possible to set the User (like correlation-Id)?

Background is that I'm in a situation where I orchestrate some microservices (in my case with Fastapi) and not all of them have/need authentication. But if Service A calls B, C, D, ... it would be very easy to send an Header (e.g. X-User-Id) so that I can use this (like the correlation id) for my distributed logs.

Thx

you can either use https://github.com/bobbui/json-logging-python#24-log-extra-properties
or if you want it be in place of correlation-id you can override the value of CORRELATION_ID_HEADERS to add your own headers