[slf4j-dev] [Bug 176] Initialization (getILoggerFactory) is not thread safe

bugzilla-daemon at qos.ch bugzilla-daemon at qos.ch
Tue Feb 4 21:05:14 CET 2014


http://bugzilla.slf4j.org/show_bug.cgi?id=176

--- Comment #28 from James R. Perkins <jperkins at redhat.com> ---
The bottom line is the initialization is not thread-safe and IMO there is no
reason for it not to be. Log messages WILL be lost at some point. A no-op
logger is just a bad idea in general.

FWIW the fix in fixSubstitutedLoggers() method isn't really thread-safe either.

The following returns a newly created list of SubstituteLoggers.
List<SubstitutableLogger> loggers = TEMP_FACTORY.getLoggers();

At the end TEMP_FACTORY.clear(); is invoked which could potentially result in a
loss of a logger that was created in SubstituteLoggerFactory while the loop is
creating the loggers on the current LoggerFactory.

I will say that fix is better than nothing though. Just ignoring the issue
isn't going to solve it :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-dev/attachments/20140204/c0d8053d/attachment.html>


More information about the slf4j-dev mailing list