Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
Description
LogbackMDCAdapter uses synchronization. Synchronization has been added to fix problems related to use of inheritable thread local (LOGBACK-434) Inheritable thread local was removed in commit aa7d584ecdb1638bfc4c7223f4a5ff92d5ee6273 to fix issues LOGBACK-422 and LOGBACK-624. Synchronization was not removed
It seems that synchronization and clever use of atomicinteger are no longer required. Logback exposes MDC variables only using single value getter and a method that returns a copy.
Removing synchronization could have significant impact on situations where you need to update MDC often. One such use case is reactive java, that requires one to update MDC between every task that logs.
Synchronization does also cause problems with project loom.
Attachments
Issue Links
- relates to (in)
-
LOGBACK-620 Performance improvement for LogbackMDCAdapter
- Resolved
- links to