[slf4j-user] Formatted logs and benchmarks

Martin Gilday martin.lists at imap.cc
Sun Jan 14 21:35:51 CET 2007


There has previously been a discussion on this mailing list about the
possibility of adding varargs to slf4j.  Since then I have made an
attempt to tidy up some of my projects by writing a wrapper for the
log4j Logger class.[1][2]
As part of this I took what someone suggested on the mailing list of
using java.util.Formatter for building up the log messages inside the
log call.  In slf4j a similar substitution into the log message takes
place.  I have found it reasonably difficult to achieve a consistant
benchmark of the effect of this String.format call, ranging from almost
equal to over 3 times slower.  

Are there any existing benchmarks on the effect of your substitutions in
slf4j, or any effective ways of recording them?

Thank you for your time,
Martin Gilday

[1] http://www.martingilday.org/updates/Formatted+Logger
[2]
http://www.martingilday.org/svn/repos/FormattedLogger/trunk/src/main/java/org/martingilday/formattedLogger/FormattedLogger.java



More information about the slf4j-user mailing list