Skip to content

Commit

Permalink
Set log levels for azure and main loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
aeshub committed Oct 13, 2022
1 parent 6a0b347 commit 761e1c6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/isar/config/logging.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ formatters:
style: "{"
format: "{asctime} - {levelprefix:<8} - {name} - {message}"
handlers:
main:
class: logging.FileHandler
formatter: simple
filename: main.log
api:
class: logging.FileHandler
formatter: simple
Expand All @@ -22,6 +26,9 @@ loggers:
console:
handlers: []
propagate: no
main:
handlers: [main]
propagate: no
api:
handlers: [api]
propagate: no
Expand All @@ -36,6 +43,9 @@ loggers:
uploader:
handlers: [uploader]
propagate: False
azure:
handlers: []
propagate: no
root:
level: DEBUG
handlers: []
4 changes: 4 additions & 0 deletions src/isar/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ class Settings(BaseSettings):
UVICORN_LOG_LEVEL: str = Field(default="WARNING")
STATE_MACHINE_LOG_LEVEL: str = Field(default="INFO")
UPLOADER_LOG_LEVEL: str = Field(default="INFO")
MAIN_LOG_LEVEL: str = Field(default="INFO")
AZURE_LOG_LEVEL: str = Field(default="WARNING")

LOG_LEVELS: dict = Field(default={})

Expand All @@ -230,6 +232,8 @@ def set_log_levels(cls, v, values) -> dict:
"uvicorn": values["UVICORN_LOG_LEVEL"],
"state_machine": values["STATE_MACHINE_LOG_LEVEL"],
"uploader": values["UPLOADER_LOG_LEVEL"],
"main": values["MAIN_LOG_LEVEL"],
"azure": values["AZURE_LOG_LEVEL"],
}

@validator(
Expand Down

0 comments on commit 761e1c6

Please sign in to comment.