Multiple instances of log4j2.xml

2016-06-17 Thread Jochen Wiedmann
Hi, I have an application (more precisely: a war file), which is deployed identically on the same application server. (Think multi temancy), Now, in Log4j 1, I handled that situation quite easily, like this: final String uri = tenantName + "/log4j.xml"; final URL url = ClassLoader.getReso

Re: Multiple instances of log4j2.xml

2016-06-17 Thread Ralph Goers
You would use Configurator.initialize(“MyContextName”, this.getClass().getClassLoader(), uri); The classLoader value can be null. Ralph > On Jun 17, 2016, at 1:41 AM, Jochen Wiedmann > wrote: > > Hi, > > I have an application (more precisely: a war file), which is deployed > identically on

Re: Multiple instances of log4j2.xml

2016-06-17 Thread Ralph Goers
I would probably use tenantName for the context name. Ralph > On Jun 17, 2016, at 6:07 AM, Ralph Goers wrote: > > You would use Configurator.initialize(“MyContextName”, > this.getClass().getClassLoader(), uri); > > The classLoader value can be null. > > Ralph > >> On Jun 17, 2016, at 1:41 A

Question about several Async Loggers + RandomAccessFIle appenders with immediateFlush = false

2016-06-17 Thread Anthony Maire
Hello As suggested in AsyncLogger javadoc, I made some performance tests on my application with (Rolling)RandomAccessFile appenders configured with immediateFlush = false to take advantage of the potential I/O batching, and the results are very good :) However I have a question about the flush on

Re: Multiple instances of log4j2.xml

2016-06-17 Thread Jochen Wiedmann
On Fri, Jun 17, 2016 at 3:07 PM, Ralph Goers wrote: > You would use Configurator.initialize(“MyContextName”, > this.getClass().getClassLoader(), uri); > > The classLoader value can be null. Thanks, Ralph. One question, though: The class Configurator is not present on http://logging.apache.or

Re: Multiple instances of log4j2.xml

2016-06-17 Thread Matt Sicker
Configurator is in log4j-core. On 17 June 2016 at 08:15, Jochen Wiedmann wrote: > On Fri, Jun 17, 2016 at 3:07 PM, Ralph Goers > wrote: > > You would use Configurator.initialize(“MyContextName”, > this.getClass().getClassLoader(), uri); > > > > The classLoader value can be null. > > Thanks, Ral

Re: Multiple instances of log4j2.xml

2016-06-17 Thread Ralph Goers
Configuration is not part of the public API - it is very implementation specific. So Configurator is part of log4j-core. However, we expect it to be used by applications so it is one of the classes in core where we try to maintain binary compatibility. Ralph > On Jun 17, 2016, at 6:15 AM, Joch