Re: Bizarre performance in log4j2

2015-12-10 Thread Strong Su
after that. Thank Erik and Remko very much. Best Regards, Dylan Su On Tue, Oct 20, 2015 at 3:38 PM, Strong Su <lovelo...@gmail.com> wrote: > Hello everyone, > I take a deep look at our project and found one of our third dependencies > was using log4j2. It is using APIs of

How can I use asyncLogger programmatically?

2015-12-09 Thread Strong Su
Hello everyone, I'm trying to use log4j2 programmatically. And I follow the instruction of Programmatically Modifying the Current Configuration after Initialization. http://logging.apache.org/log4j/2.x/manual/customconfig.html#AddingToCurrent That worked but it's using syncLogger. I think

Re: How can I use asyncLogger programmatically?

2015-12-09 Thread Strong Su
It turns out that I should also init a new AsyncLoggerContext. And then it will work and use asyncLogger. On Wed, Dec 9, 2015 at 10:30 PM, Strong Su <lovelo...@gmail.com> wrote: > Hello everyone, > > I'm trying to use log4j2 programmatically. And I follow the instruction of >

Re: Bizarre performance in log4j2

2015-10-20 Thread Strong Su
appender and includeLocation="false" to print other logs Will it be difference if they print logs in two separate files? Thank you very much. Best regards, Dylan Su On Fri, Oct 16, 2015 at 7:21 PM, Strong Su <lovelo...@gmail.com> wrote: > Hello everyone, > > It tak

Difference between and -DAsyncLoggerContextSelector

2015-10-19 Thread Strong Su
Hello everyone, I'm not pretty sure about the difference and -DAsyncLoggerContextSelector. Here is a small slice example of log4j2.xml:

Re: Difference between and -DAsyncLoggerContextSelector

2015-10-19 Thread Strong Su
> wrote: > > > if you set -DAsyncLoggerContextSelector ,all the asyncRoot node should be > > changed to Root, because needn't. > > the difference is set DAsyncLoggerContextSelector make all the logger > > async,however. asyncRoot only make async inclued in the node. &

Re: Bizarre performance in log4j2

2015-10-16 Thread Strong Su
from beginning to checkout where the problem is. I will update this thread or link this problem to a new thread when the performance becomes normal. Thank you very much for the advices during these days. Best regards, Dylan Su On Wed, Oct 14, 2015 at 4:58 PM, Strong Su <lovelo...@gmail.com>

Re: Bizarre performance in log4j2

2015-10-13 Thread Strong Su
Popma <remko.po...@gmail.com> > wrote: > > > Please remove log4j-1.2.16 and replace it with log4j-1.2-api version 2.3. > > > > Also remove slf4j-log4j12 and add log4j-slf4j-impl version 2.3. > > > > Sent from my iPhone > > > > > On 2015/10/13,

Re: Bizarre performance in log4j2

2015-10-12 Thread Strong Su
Here is my console debug with status="trace". I found that log4j2 didn't get SleepWaitingStrategy by default and I didn't find includeLocation in console. 2015-10-12 18:55:25,424 DEBUG Starting LoggerContext[name=2090228673] from configuration at jndi:/localhost/WEB-INF/log4j2.xml 2015-10-12

Re: Bizarre performance in log4j2

2015-10-12 Thread Strong Su
ll _only_ take a > > snapshot of the stack when the layout needs it. In your case this is > never, > > so you get fast performance. > > > > The solution is to change your config to > > > > > > If you test this with async loggers you should see a perform

Re: Bizarre performance in log4j2

2015-10-12 Thread Strong Su
? > > > > On Mon, Oct 12, 2015 at 12:58 PM, Strong Su <lovelo...@gmail.com> wrote: > > > Here is my console debug with status="trace". > > I found that log4j2 didn't get SleepWaitingStrategy by default and I > didn't > > find includeLocation in console

Re: Bizarre performance in log4j2

2015-10-12 Thread Strong Su
Logger LOG= LogManager.getLogger(A.class); {...} LOG.info("Log4j_TEST"); On Tue, Oct 13, 2015 at 10:43 AM, Gary Gregory <garydgreg...@gmail.com> wrote: > Can you use 2.4? > > Gary > > On Mon, Oct 12, 2015 at 6:56 PM, Strong Su <lovelo...@gmail.com

Re: Bizarre performance in log4j2

2015-10-12 Thread Strong Su
hone > > > On 2015/10/13, at 11:43, Gary Gregory <garydgreg...@gmail.com> wrote: > > > > Can you use 2.4? > > > > Gary > > > >> On Mon, Oct 12, 2015 at 6:56 PM, Strong Su <lovelo...@gmail.com> wrote: > >> > >> I'm using L

Re: Bizarre performance in log4j2

2015-10-11 Thread Strong Su
> Can you post your log4j2 configuration? > > Sent from my iPhone > > > On 2015/10/10, at 21:58, Strong Su <lovelo...@gmail.com> wrote: > > > > I insert a log in a http request function on server side. And I start > > requests continually on client

Re: Bizarre performance in log4j2

2015-10-11 Thread Strong Su
my log4j2.xml was using async appender and sync logger? If so, which property opens async appender by default? And will using async logger and async appender at the same time reduce the performance? On Sun, Oct 11, 2015 at 6:21 PM, Strong Su <lovelo...@gmail.com> wrote: > My lo

Re: How to make all loggers async when run war file?

2015-10-10 Thread Strong Su
the > > $CATALINA_BASE/conf/catalina.properties file. > > > > Also relevant: > > > http://wiki.apache.org/tomcat/HowTo#Can_I_set_Java_system_properties_differently_for_each_webapp.3F > > > > > > > > On Fri, Oct 9, 2015 at 1:41 PM, Strong Su &l

Bizarre performance in log4j2

2015-10-10 Thread Strong Su
Hello everyone, I'm still testing log4j2 on our projects. When using it, I find it has a beautiful performance when using sync log4j2. But it turns terrible when I add -DLog4jContextSelector or change to in log4j2.xml to use async log4j2. I don't even have a clue on explaining this.What could

Re: Bizarre performance in log4j2

2015-10-10 Thread Strong Su
.po...@gmail.com> wrote: > How did you measure the good performance (with sync logging) and the bad > performance (with async)? What happens exactly when "it turns terrible"? > > On Saturday, 10 October 2015, Strong Su <lovelo...@gmail.com> wrote: > > > Hello eve

How to make all loggers async when run war file?

2015-10-09 Thread Strong Su
Hello everyone, I'm testing log4j2 performance on our own projects. And I prepare to add -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector to make all loggers async. But I need to upload war file to the server. I get the war file through "maven build" in

Help about log4j tests

2015-09-21 Thread Strong Su
Hello everyone, I'm ready to update log4j1 to log4j2. But when I run the tests from log4j-perf with java -jar log4j-perf/target/benchmarks.jar ".*Async.*Benchmark.*" -f 1 -wi 5 -i 5 java -jar log4j-perf/target/benchmarks.jar ".*Async.*Benchmark.*" -f 1 -wi 5 -i 5 -t 4 -si true I have a little