Use logger for error logging.