Exception handling added to logger.