Quoting Ceki G�lc� <[EMAIL PROTECTED]>:
> Jake, > > I see your point. Do you see anything wrong with the following? >
The only problem I see with it is that this should be done inside LogManager.setRepositorySelector() rather than in custom initialization code beause we need to guarantee that selector.getLoggerRepository() never returns null. We can't do that if we count on external initialization code to "do the right thing".
Are you forgetting that in the absence of specific instructions from the user, the static initializer in LogManager sets a DefaultRepositorySelector and sets the default repository of DefaultRepositorySelector? I am referring to line 85 of LogManager.
Otherwise, my changes would look similar to this. Inside LogManager.setRepositorySelector(), I have something like (from memory)...
LoggerRepository currentDefaultRepository = repositorySelector.getLoggerRepository(); newSelector.setDefaultRepository(currentDefaultRepository); repositorySelector = newSelector;
This code imposes a default repository instance to the new selector. Maybe the new selector wants to return its own default repository, possibly of a different type than o.a.l.Hiearchy? Do you see why leaving LogManager.setRepositorySelector() as is has at least some advantages?
Actually, come think of it, to really lave wiggling room for the new selector, line 85 should be modified
from:
84 // at this stage 'repositorySelector' should point to a valid selector 85 repositorySelector.setDefaultRepository(defaultHierarchy);
to:
84 // at this stage 'repositorySelector' should point to a valid selector
85 if(repositorySelector.getDefaultRepository() == null) {
86 repositorySelector.setDefaultRepository(defaultHierarchy);
87 }Do you concur?
-- Ceki G�lc�
The complete log4j manual: http://qos.ch/eclm
Professional log4j support: http://qos.ch/log4jSupport
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
