bobbui / json-logging-python

Cloud-native distributed Python logging library to emit JSON log that can be easily indexed by logging infrastructure
Apache License 2.0
303 stars 62 forks source link

Can I SET the correlation_id (in non-http context)? #69

Closed howardjones closed 3 years ago

howardjones commented 3 years ago

I have a process that listens for MQ events from elsewhere, and makes API requests based on them. We are looking at adding correlation_id to the MQ event data (they did ultimately originate from a HTTP request) but can I set the correlation_id in my MQ listener, so that its logs contain it and so that the API calls can use it?

bobbui commented 3 years ago

@howardjones Updated the docs to explain how to manually set the correlation id: https://github.com/bobbui/json-logging-python#forced-overriding-correlation-id