Attempting to initialize resource bundle property of root logger via XML configuration file. Configurator recognizes "resourceBundle" to be a valid property name but throws a WARN message saying "Failed to set property [resourceBundle]". Traced problem to setProperty() method of PropertySetter class. Call to convertArg() does not return a valid 'arg' (i.e. null) since there is no processing within convertArg() to convert the 'val' parameter (which is the name of the resource bundle) to an object of the specified type (which is a java.util.ResourceBundle) which results in a PropertySetterException being thrown. Only way to get resource bundles to work is to set them explicitly within source code via the setResourceBundle() method.
I don't see how this was supported (if ever). Changing the name to match what is necessary. What the DTD should say is: <!ELEMENT logger (level?,appender-ref*)> <!ATTLIST logger name ID #REQUIRED additivity (true|false) "true" resourceBundle CDATA #IMPLIED > And then LoggerAction would load the appropriate resource bundle. It seems to have fairly minimal impact to add this.
Fixed in SVN trunk. DTD updated. But I probably need to add a few example files as documentation.
Committed by Elias against log4j/trunk in rev 500752.
rev 500752 is not in the history for org.apache.log4j.spi.Configurator in trunk (i.e. log4j 1.2). Is this bug still applicable for log4j 1.2, and what is the status?
No response in a month. Setting status to NEEDINFO.
Since comment #3, log4j 1.3 was moved from log4j/trunk to log4j/branches/BRANCH_1_3_ABANDONED. The patch there is log4j 1.3 specific, however the enhancement request is appropriate for log4j 1.2 and the unit tests might be reused. Still open for anyone who wants to take a shot at it.
Reset assignee