We can use if(logger.isDebugEnabled())