[ 
https://issues.apache.org/jira/browse/DAFFODIL-2510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17371436#comment-17371436
 ] 

Mike Beckerle commented on DAFFODIL-2510:
-----------------------------------------

After much investigation I suggest that the right way to fix this is NOT to 
pass loggers everywhere, but rather to centralize loggers in a thread-safe way. 
Passing loggers is just tedious and will touch almost every file in the system 
for very little benefit.

Improving the distinction between logger messages and "debug by print 
statement", i.e., making log messages less frequent, and not trying for them to 
be a substitute for debugging, will reduce the number of logging calls 
substantially which will mitigate performance impact of making the logging 
thread safe via thread-local object access and/or synchronization.

> Thread Safety: Improve Logger/Logging 
> --------------------------------------
>
>                 Key: DAFFODIL-2510
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2510
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Back End, CLI, Front End, Libraries, Middle 
> "End", TDML Runner
>    Affects Versions: 3.0.0
>            Reporter: Mike Beckerle
>            Priority: Major
>
> Every object that mixes in the Logging trait gets its own mutable vars for 
> logWriter and logLevel, and if not set, shares a single global state in the 
> LoggingDefaults object.
> This is not thread safe. At minimum LoggingDefaults should be a ThreadLocal.
> Furthermore, those objects don't need independent ability to specify a unique 
> logger or logging level. They should be sharing a logger supplied by the 
> application.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to