Resource bundles contain localized text for internationalization purposes, not 
configuration data. It is unfortunate that Sun chose to use the same properties 
file format for resource bundles and properties files, but using the 
PropertyResourceBundle class to read a property file is not something you 
should be doing as the getBundle call will be looking for files such as 
log4j2_en_us.properties and using those along with log4j2.properties. As such, 
Log4j 2 doesn’t support using a resource bundle like that. Instead, you should 
be using the Properties class.

Ralph


> On Dec 13, 2017, at 11:23 PM, Kavitha Balan Nair 
> <kavitha.balan.n...@oracle.com> wrote:
> 
> 
> 
> 
> 
> 
> 
> Hi,
> 
> 
> 
> In our project we get the properties file into a resourcebundle. So I need to 
> configure it through that bundle. 
> 
> 
> 
> Is there any way to get  that bundle for configuring it.
> 
> 
> 
> Log4j 2.9.1 version is been used.
> 
> 
> 
> Code snippet:
> 
>               PropertyResourceBundle bundle = (PropertyResourceBundle) 
> PropertyResourceBundle.getBundle("log4j2");
> 
>                 //what should be the format to fill the parameters .
>                 ConfigurationSource configurationSource = new 
> ConfigurationSource(________);
> 
> I cannot use the ConfigurationSource.fromUri or fromResource.
> 
> Any idea with this ?
> 
> Thanks,
> Kavitha
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to