On 09/04/2013 02:56 PM, Daniel Fuchs wrote:
Hi,

Please find below a changeset that will fix

8023168: Cleanup LogManager class initialization and
          LogManager/LoggerContext relationship.

<http://cr.openjdk.java.net/~dfuchs/webrev_8023168/webrev.00/>

LogManager class initialization is fragile: because Logger
constructor calls LogManager.getLogManager, and because
LogManager calls new Logger during LogManager class initialization,
and because the global logger is instantiated during Logger class
initialization, loading Logger.class or LogManager.class can lead to
challenging hard to diagnose issues.

As far as calling initialization ("ensureLogManagerInitialized()"), it's a shame that checking for a one-time action has to run through a synchronization block every time. Maybe a "lazy holder" class would be more appropriate here, especially given that the point seems to be to produce the RootLogger() instance which doubles as the indicator that initialization was done.

There's a grammatical error in the comment at line 1547 of LogManager.java: "We do not the protected Logger <...>".

--
- DML

Reply via email to