Open tstrg opened 3 months ago
The logger
should not be used as a way to store / access values. It mainly meant to provide context to the logged message.
There is no way to access the contextualized value outside of the sink itself (and function such as filter
).
I would advise to use contextvars
directly instead.
Thank you for your feedback.
I understand that the logger is primarily intended to provide context to logged messages rather than storing or accessing values. I'll explore using contextvars directly for managing contextual values.
Thanks again for your guidance!
Hello,
I'm trying to understand how to read contextualized values within the do_something() function when using the logger.contextualize() method. Here is an example of my code: