we use log4j and the code is proliferated with if(logger.isDebugEnabled()) check to avoid string concatenation if the log level is INFO, but many developers forget to add this check and most of the time this problem is not noticed. Every penny counts when the system is under heavy pounding. I ran across Log5j and this solves this problem by delegating string interpolation to the log5j api which can discard the interpolation if log level is not met. From Log5j website
in log4j:
in log4j:
log.debug( "This thing broke: " + foo + " due to bar");in log5j:
log.debug( "This thing broke: %s due to bar", foo);
Comments
Post a Comment