Logger method for logging exceptions, used in ExceptionHandler