Perf fixes. log.isDebugEnabled check added for log statements.