Skip to content

Commit

Permalink
Fix the azure logging handler in Everest
Browse files Browse the repository at this point in the history
* Fix the azure logging handler in Everest

Co-authored-by: DanSava <[email protected]>
  • Loading branch information
verveerpj and DanSava authored Dec 3, 2024
1 parent c4b5b67 commit 13fdda2
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/everest/detached/jobs/everserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ def make_handler_config(
"filename": path,
}

def azure_handler():
azure_handler = get_azure_logging_handler()
if azure_handler:
return azure_handler
return logging.NullHandler()

logging_config = {
"version": 1,
"disable_existing_loggers": False,
Expand All @@ -219,27 +225,20 @@ def make_handler_config(
"forward_models": make_handler_config(
log_dir / "forward_models.log", logging_level
),
"azure_handler": {"()": azure_handler},
},
"loggers": {
"": {"handlers": ["root"], "level": "NOTSET"},
"res": {"handlers": ["res"]},
"everserver": {"handlers": ["everserver"]},
"everest": {"handlers": ["everest"]},
"everest": {"handlers": ["everest", "azure_handler"]},
"forward_models": {"handlers": ["forward_models"]},
},
"formatters": {
"default": {"format": DEFAULT_LOGGING_FORMAT},
},
}

azure_handler = get_azure_logging_handler()
if azure_handler:
logging_config["handlers"]["azure"] = {
"class": "azure_handler",
"level": logging_level,
}
logging_config["loggers"]["everest"]["handlers"].append("azure")

logging.config.dictConfig(logging_config)


Expand Down

0 comments on commit 13fdda2

Please sign in to comment.