Changed logger.error in code to app.logger.error.