Re: Separate appender for each application in same Tomcat

2016-04-15 Thread Niranjan Rao
You know your environment better and know all the problems, but I think I am getting confused. Is it same application deployed with two different WAR files? I mean say app.war copied as prod.war and qa.war? How do applications know where to find other settings? Is it read from the resources or

Re: Dynamically creating loggers

2016-04-15 Thread Ralph Goers
That depends on the environment. You could be getting the Logger from the wrong LoggerContext. Ralph > On Apr 15, 2016, at 7:13 AM, Matt Sicker wrote: > > Couldn't he just cache the LoggerContext and use LoggerContext.getLogger() > to avoid the ContextSelector lookup? > > On 15 April 2016 at

Re: Dynamically creating loggers

2016-04-15 Thread Matt Sicker
Couldn't he just cache the LoggerContext and use LoggerContext.getLogger() to avoid the ContextSelector lookup? On 15 April 2016 at 08:19, Ralph Goers wrote: > The logging implementation stores the logger in a map. However, when you > call getLogger ClassLoaderContextSelector will have to locat

Re: Dynamically creating loggers

2016-04-15 Thread Ralph Goers
The logging implementation stores the logger in a map. However, when you call getLogger ClassLoaderContextSelector will have to locate the ClassLoader for the class loading the Logger. This can be fairly expensive. If you are using a different ContextSelector it might work better. Or you can cr

Re: Separate appender for each application in same Tomcat

2016-04-15 Thread Denis Kostousov
I include in ejb-jar a properties file log4j2.component.properties that contains a full path to log4j configuration file for this app: % cat ./admin-ui/src/main/resources/log4j2.component.properties log4j.configurationFile=${sys:jboss.server.config.dir}/wallet-admin-log4jv2.xml On 15.04.2016 13:

Dynamically creating loggers

2016-04-15 Thread Jochen Wiedmann
Hi, I've got an application, where I would like to obtain loggers on the fly, because the logger name isn't known in advance. (Think of it as a logging server, which will be used by remote clients.) Now, creating a Logger might be an expensive operation. Thus, my question: - Would you recommend

Re: Separate appender for each application in same Tomcat

2016-04-15 Thread Steven Yang
First of all thanks to all suggestions. I dont think setting system property solves my issue because they are both in the same tomcat which means they share the same system property. setting the log4jConfiguration in web.xml means I will always have to set it even if I am in local development rig