Re: "Custom Container" logging

2016-06-20 Thread Matt Sicker
If you're still interested in this problem, you can use the EventLogger for this sort of thing. Docs: https://logging.apache.org/log4j/2.x/manual/eventlogging.html On 19 January 2015 at 06:50, David Lee wrote: > I have an normally command line or embedded application that can start a > separate

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

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: Question about several Async Loggers + RandomAccessFIle appenders with immediateFlush = false

2016-06-20 Thread Anthony Maire
I succeed to reproduce the issue I was suspecting to happen : https://issues.apache.org/jira/browse/LOG4J2-1441 2016-06-17 15:11 GMT+02:00 Anthony Maire : > Hello > > As suggested in AsyncLogger javadoc, I made some performance tests on my > application with (Rolling)RandomAccessFile appenders c

Re: How exactly are you supposed to use CloseableThreadContext?

2016-06-20 Thread Matt Sicker
That worked, thanks. I'll update the javadocs, too. On 20 June 2016 at 09:01, Greg Thomas wrote: > Ah, yes. It seems the javadocs are wrong :( They pre-date the > introduction of the helper class > > A better (i.e. working!) example is at > https://logging.apache.org/log4j/2.x/manual/thread-cont

Re: How exactly are you supposed to use CloseableThreadContext?

2016-06-20 Thread Greg Thomas
Ah, yes. It seems the javadocs are wrong :( They pre-date the introduction of the helper class A better (i.e. working!) example is at https://logging.apache.org/log4j/2.x/manual/thread-context.html @Test public void name() throws Exception { try (final CloseableThreadContext.Instance ctc = Clo

How exactly are you supposed to use CloseableThreadContext?

2016-06-20 Thread Matt Sicker
I tried doing it like in the javadocs and get a compilation error: @Test public void name() throws Exception { try (CloseableThreadContext.put("key", "value")) { } } List of errors: RequestIdFilterTest.java:12: error: expected try (CloseableThreadContext.put("key", "value")) {

Re: Generating SNMP traps from Java Application

2016-06-20 Thread girish kulkarni
Mark Masterson compuserve.com> writes: > > Hi Swarna, > > Ah, fantastic. Swarna, I've been meaning to get to your mail (to me > directly) for about a week now, but I wanted to "cc" my reply to the > log4j list, since most of your questions are generic log4j questions, > and not specific to