logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Wiedmann <jochen.wiedm...@gmail.com>
Subject Multiple instances of log4j2.xml
Date Fri, 17 Jun 2016 08:41:42 GMT
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.getResource(uri);
    if (uri == null) {
        throw new IllegalStateException("Unable to locate logging
configuration: " + uri);
    }
    DOMConfigurator.configure(url);

Or, in other words: For every tenant, I have a directory for
configuration files, including log4j.xml.
Simple, quick, and worked absolutely reliable.

But, how do I get this to work with log4j2?

Thanks,

Jochen

-- 
The next time you hear: "Don't reinvent the wheel!"

http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-of-the-wheel-300x85.jpg

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


Mime
View raw message