Hello,

Looking at the log4j/log42/logback comparison [1], I have noticed a
number of inaccuracies.

item 2) The performance of deciding whether to log or not to log when
logging is turned on.

Logback does not walk the hierarchy. No, really. It doesn't.

item 2) Actually outputting log messages

For the log4j2 figures your have the "immediateFlush" property set to
false. For the logback figures you have "immediateFlush" property set
to true.

Quoting from [2] and [3]

By default, the OutputStream is immediately flushed, unless the
immediateFlush property is explicitly set to 'false'. Setting the
immediateFlush property to false can significantly improve logging
throughput.

The default value for immediateFlush is 'true'. Immediate flushing of
the output stream ensures that logging events are immediately written
to disk and will not be lost in case your application exits without
properly closing appenders. On the other hand, setting this property
to 'false' is likely to quintuple (your mileage may vary) logging
throughput. As mentioned previously, if immediateFlush is set to
'false' and if appenders are not closed properly when your application
exits, then logging events not yet written to disk may be lost.  ===
====

For an honest comparison, both frameworks should use comparable
settings. In this particular case, the setting is called
"immediateFlush" and carries the same name in both frameworks.


[1] http://logging.apache.org/log4j/2.x/performance.html
[2] http://logback.qos.ch/manual/encoders.html#LayoutWrappingEncoder
[3] http://logback.qos.ch/manual/encoders.html#immediateFlush

--
Ceki

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to