Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix #2245 use unique run ID to name logger instance #2247

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions metplus/util/config_metplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def launch(config_list):
config.set('config', 'CONFIG_INPUT', ','.join(config_format_list))

# save unique identifier for the METplus run
config.set('config', 'RUN_ID', str(uuid.uuid4())[0:8])
config.set('config', 'RUN_ID', config.run_id)

# get OUTPUT_BASE to make sure it is set correctly so the first error
# that is logged relates to OUTPUT_BASE, not LOG_DIR, which is likely
Expand Down Expand Up @@ -450,7 +450,8 @@ def __init__(self, conf=None):
interpolation=None) if (conf is None) else conf
super().__init__(conf)
self._cycle = None
self._logger = logging.getLogger('metplus')
self.run_id = str(uuid.uuid4())[0:8]
self._logger = logging.getLogger(f'metplus.{self.run_id}')
# config.logger is called in wrappers, so set this name
# so the code doesn't break
self.logger = self._logger
Expand Down