r500752 | eross | 2007-01-28 01:38:39 -0600 (Sun, 28 Jan 2007) | 3 lines

Bug 23329 -
<logger> element in XML config should support resourceBundle attribute No support yet for .properties files, but XML-only is probably ok


Index: src/java/org/apache/log4j/joran/action/LoggerAction.java
===================================================================
30a31,32
> import java.util.MissingResourceException;
> import java.util.ResourceBundle;
35a38,39
>   final static String RESOURCE_BUNDLE = "resourceBundle";
>
95a100,109
>
>     String resourceBundle = attributes.getValue(RESOURCE_BUNDLE);
>     try {
> ResourceBundle bundle = ResourceBundle.getBundle (resourceBundle);
>       l.setResourceBundle(bundle);
>       getLogger().debug(
> "Setting [" + l.getName() + "] resourceBundle to [" + resourceBundle + "].");
>     } catch (MissingResourceException e) {
> getLogger().error("Error loading resource bundle [" + resourceBundle + "]", e);
>     }
Index: src/java/org/apache/log4j/xml/log4j.dtd
===================================================================
120a121
>   resourceBundle CDATA   #IMPLIED
Index: tests/src/java/org/apache/log4j/joran/JoranConfiguratorTest.java
===================================================================
53a54
>   JoranConfigurator jc = new JoranConfigurator();
70,71c71
<     JoranConfigurator jc = new JoranConfigurator();
< jc.doConfigure("./input/joran/simple2.xml", LogManager.getLoggerRepository());
---
> jc.doConfigure("tests/input/joran/simple2.xml", LogManager.getLoggerRepository());
78a79,85
>   public void testResourceBundle() {
> jc.doConfigure("./input/joran/resourceBundle.xml", LogManager.getLoggerRepository());
>     Logger l = Logger.getLogger("foo");
>     assertNotNull(l.getResourceBundle());
>     assertNull(Logger.getLogger("bar").getResourceBundle());
>   }
>
80,82c87,88
<     JoranConfigurator joc = new JoranConfigurator();
< joc.doConfigure("./input/joran/asyncTest.xml", LogManager.getLoggerRepository());
<     joc.dumpErrors();
---
> jc.doConfigure("./input/joran/asyncTest.xml", LogManager.getLoggerRepository());
>     jc.dumpErrors();
125,130d130
<   public static Test suite() {
<     TestSuite suite = new TestSuite();
<     suite.addTest(new JoranConfiguratorTest("testAsync"));
<     return suite;
<    }
<


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to