I have a situation in which I want to print all the exception caught in catch block using logger.
try { File file = new File(\"C:\\\\className\").mkdir(
Use: LOGGER.log(Level.INFO, "Got an exception.", e); or LOGGER.info("Got an exception. " + e.getMessage());
LOGGER.log(Level.INFO, "Got an exception.", e);
LOGGER.info("Got an exception. " + e.getMessage())