Logging config and error handling