Is there an easy/recommended way to initialize Log4j2 so it works properly in a @Startup @Singleton EJB, or in a static EJB class member?

2016-03-03 Thread Joachim Kanbach
Hi all, I'm currently in the process of migrating my existing Java EE Web Profile applications, running on GlassFish 4.1, from JUL to Log4j2. That is, not just the application logging but also the server logging (cf. http://mail-archives.apache.org/mod_mbox/logging-log4j-user/201603.mbox/%3Ctri

Re: Is there an easy/recommended way to initialize Log4j2 so it works properly in a @Startup @Singleton EJB, or in a static EJB class member?

2016-06-20 Thread Matt Sicker
Have you tried using log4j as a server library instead of adding it to your deployment artifacts? If you do that, you should be able to avoid using log4j-web entirely as well which is mainly used for .war deployments. On 3 March 2016 at 07:54, Joachim Kanbach wrote: > Hi all, > > I'm currently i

Re: Is there an easy/recommended way to initialize Log4j2 so it works properly in a @Startup @Singleton EJB, or in a static EJB class member?

2016-06-20 Thread Ralph Goers
From what I am reading, that is what he is doing. As you noted, the ClassLoaderContextSelect tries to associate the Logger being created with the correct LoggerContext - which should be the LoggerContext associated with the ClassLoader for the class obtaining the Logger. It sounds like it some