Bug 43325

Summary: Subst-mechanism in DOMConfigurator broken
Product: Log4j - Now in Jira Reporter: Lars Beuster <lbe.tech>
Component: ConfiguratorAssignee: log4j-dev <log4j-dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.2   
Target Milestone: ---   
Hardware: Other   
OS: other   
Bug Depends on:    
Bug Blocks: 43313    

Description Lars Beuster 2007-09-07 02:58:49 UTC
With the new 1.2.15 release the subst-mechanism doesn't work in all cases.

Prior the 1.2.15 release I could override the protected instance method
DOMConfigurator.subst(String) to delegate all value substitutions to my own
properties object. Per default the original subst()-method calls another static
subst()-method.
Now the setParameter()-method calls the static subst()-method directly and the
instance-method isn't called anymore.

The other subst-mechanism with the member "properties" fails because that member
is package protected and has no setter. Even log4j doesn't set the member to any
value - so it's always null.

Regards
Lars
Comment 1 Curt Arnold 2007-10-22 13:33:25 UTC
Added unit test and fix in rev 587235.  DOMConfigurator.subst() should now be consulted in all the places 
it was in log4j 1.2.14.  

It will not be consulted when processing unrecognized elements, the parseUnrecognizedElement method 
of the appender (or other object) is passed a Properties object and does not have access to the 
DOMConfigurator.  If you want to interact with the property evaluation of unrecognized elements, then 
you have to tweak the Properties object passed on parseUnrecognizedElement.