From afcce6d7493faaa2acf94c01268a2551a1300d31 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 10 Aug 2023 03:54:25 +0900 Subject: [PATCH] Initialize logger for rpc-server and wsgi script Currently logger is not properly initialized according to config options or process arguments when the neutron-rpc-server script or the api wsgi script is used. Because of this neutron does not generate the log files as expected when we deploy api using WSGI and use neutron-rpc-server, instead of the monolithic neutron-server. This ensures the logger is initialized even when these two scripts are used. Closes-Bug: #2030904 Related-Bug: #1693691 Change-Id: I13bcd36c237555e0ca60d5ffc214b8f3bf6e478f --- neutron/server/__init__.py | 1 + neutron/service.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/neutron/server/__init__.py b/neutron/server/__init__.py index db43757b94f..ed46b8f675d 100644 --- a/neutron/server/__init__.py +++ b/neutron/server/__init__.py @@ -53,6 +53,7 @@ def _init_configuration(): conf_files = _get_config_files() config.register_common_config_options() config.init(sys.argv[1:], default_config_files=conf_files) + config.setup_logging() config.set_config_defaults() if not cfg.CONF.config_file: sys.exit(_("ERROR: Unable to find configuration file via the default" diff --git a/neutron/service.py b/neutron/service.py index 99af75458a3..d0912336c40 100644 --- a/neutron/service.py +++ b/neutron/service.py @@ -75,8 +75,6 @@ class NeutronApiService(WsgiService): @classmethod def create(cls, app_name='neutron'): - # Setup logging early - config.setup_logging() service = cls(app_name) return service