The benchmark itself sets the system property to opt into 
AsyncLoggerContextSelector:
https://github.com/ceki/logback-perf/blob/5f6b10693959b6ecf1b82abddb052e89fe063e89/src/main/java/ch/qos/logback/perf/AsyncWithFileAppenderBenchmark.java#L61
 
<https://github.com/ceki/logback-perf/blob/5f6b10693959b6ecf1b82abddb052e89fe063e89/src/main/java/ch/qos/logback/perf/AsyncWithFileAppenderBenchmark.java#L61>

There’s some discussion on 
https://gist.github.com/carterkozak/891ea382a12782b772571059d62d501a 
<https://gist.github.com/carterkozak/891ea382a12782b772571059d62d501a>

-ck

> On Aug 20, 2021, at 8:04 PM, Ralph Goers <[email protected]> wrote:
> 
> I don’t understand. His async configuration for Log4j 2 isn’t async. I didn’t 
> see him set the system property. The log4j2 config file says
> 
> <!-- No need to set system property "log4j2.contextSelector" to any value 
>       when using <asyncLogger> or <asyncRoot>. -->
> But he didn’t configure an AsyncLogger or AsyncRoot and there is no Async 
> Appender configured.
> 
> Ralph
> 
>> On Aug 20, 2021, at 9:14 AM, Carter Kozak <[email protected]> wrote:
>> 
>> Benchmarks were using an unpublished version of logback that works 
>> differently than the release version I tested against -- continuing the 
>> conversation there, but I'll report back here once dust settles. Rerunning 
>> the benchmarks with a logback snapshot from source shows that async logback 
>> with one logging thread outperforms async log4j2 with 1 logging thread, 
>> however log4j2 performs better with 20 threads. I still need to do a bit of 
>> deeper investigation but will be busy with work for the next several hours.
>> 
>> On Fri, Aug 20, 2021, at 12:10, Ralph Goers wrote:
>>> Feel free to respond to his tweet. 
>>> 
>>> Ralph
>>> 
>>>> On Aug 20, 2021, at 7:15 AM, Carter Kozak <[email protected]> wrote:
>>>> 
>>>> Thanks for flagging this! I've responded to the tweet, copying it here as 
>>>> well for posterity:
>>>> 
>>>> Looking at the logback benchmark it appears that no bytes are being 
>>>> written to target/test-output/logback-async-perf.log. Upon closer 
>>>> inspection the logback asyncappender is in an started=false state, 
>>>> rejecting all input events.
>>>> https://twitter.com/carter_kozak/status/1428721705464238085?s=20
>>>> 
>>>> -ck
>>>> 
>>>> On Fri, Aug 20, 2021, at 01:13, Volkan Yazıcı wrote:
>>>>> Hello,
>>>>> 
>>>>> Ceki has recently posted a Tweet stating that both log4j 1 and logback
>>>>> performs better than log4j 2 in async mode:
>>>>> 
>>>>> https://twitter.com/ceki/status/1428461637917360131?s=19
>>>>> https://github.com/ceki/logback-perf
>>>>> 
>>>>> I don't know much about how async wiring is done under the hood, yet, if
>>>>> his claim is true, that is pretty concerning. Would anybody mind sparing
>>>>> some time to investigate if the configuration he employs is tuned good
>>>>> enough and the results are accurate, please?
>>>>> 
>>>>> Kind regards.
>>>>> 
>>> 
>>> 
>>> 
> 

Reply via email to