<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">In a previous project I switched from commons-logging -> log4j to sl4j -> logback. </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">One of the reasons I did that was the overhead in log4j when providing a object in the log... </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">log.debug("This is a object" + object); </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">would cause the object.toString to be called even debug was not enabled. </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Now I work on a new project that uses commons-logging -> sl4j -> logback (jcl-over-slf4j) </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">My question is now, will this still call object.toString.. even debug is not enabled </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">import org.apache.commons.logging.Log; </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">import org.apache.commons.logging.LogFactory; </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">.... </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">log.debug("This is a object" + object); </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I would like to get rid of commons-logging and jcl-over.sl4j and only have sl4j and logback.</span><br clear="all">
<div><br></div><br>