Extract two helpers into a shared file: - logAllServerErrors(app) - logServerErrorsOtherThan(statusCode, app)