Possible Duplicate:
Is there a need to do a if(log.isDebugEnabled()) { … } check?
My question is why do we need to check log.isDebugEnabled condition before writing into logs. In production environment i will not give Debug mode at all. So only errors will be logged. In such cases , i feel this extra condition is a burden. Can anyone please explain me the logic behind writing.