Thread local MDC #426
-
We currently use log4cplus and make extensive use of the MDC (thread local context). During certain operations, we want to add the same property to a set of logs
Quill doesn't appear to have the same capability? Any suggestions on getting similar results from Quill? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's challenging to implement this feature due to the library's design constraints. The format string, such as As a result, this feature is not currently supported. An alternative approach is to pass the I'll explore the possibility of adding this functionality in the future but I will only consider adding it if it can be implemented without introducing any additional overhead to the frontend. |
Beta Was this translation helpful? Give feedback.
It's challenging to implement this feature due to the library's design constraints. The format string, such as
Start operation... [property_1: {}, property_2: {}]
cannot be a runtime string, making it difficult to dynamically add properties as the number of the properties needs to be known at compile time. Furthermore, since all formatting in this library occurs asynchronously on the backend thread, we must ensure that the added property remains unchanged or take a copy of all properties for each logged message.As a result, this feature is not currently supported. An alternative approach is to pass the
id
with each log statement.I'll explore the possibility of adding this functionality …