Refactor config_logging()