Bug 23329 - <logger> element in XML config should support resourceBundle attribute
Summary: <logger> element in XML config should support resourceBundle attribute
Status: NEW
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Configurator (show other bugs)
Version: 1.2
Hardware: PC Windows XP
: P3 enhancement
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-22 13:33 UTC by Jeffrey Mock
Modified: 2009-06-10 13:22 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey Mock 2003-09-22 13:33:45 UTC
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.
Comment 1 Elias Ross 2007-01-26 15:21:15 UTC
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.
Comment 2 Elias Ross 2007-01-27 23:40:30 UTC
Fixed in SVN trunk.

DTD updated.  But I probably need to add a few example files as documentation.
Comment 3 Curt Arnold 2007-01-30 14:47:08 UTC
Committed by Elias against log4j/trunk in rev 500752.
Comment 4 Thorbjørn Ravn Andersen 2008-07-01 15:42:12 UTC
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?
Comment 5 Thorbjørn Ravn Andersen 2008-08-02 09:50:14 UTC
No response in a month.  Setting status to NEEDINFO.
Comment 6 Curt Arnold 2008-08-05 17:15:30 UTC
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.
Comment 7 Mark Thomas 2009-06-10 13:22:06 UTC
Reset assignee