-
Notifications
You must be signed in to change notification settings - Fork 223
Open
Description
This is not the correct way to configure the root logger. This configures the logger named "root", which is a child of the actual root logger. The effect is that logger = logging.getLogger("my_logger") does not use the configuration from the JSON (since "my_logger" is not a child of "root", but of the actual root logger, which has not been configured).
VideosSampleCode/videos/135_modern_logging/logging_configs/2-stderr-json-file.json
Lines 39 to 47 in b6fe3c8
| "loggers": { | |
| "root": { | |
| "level": "DEBUG", | |
| "handlers": [ | |
| "stderr", | |
| "file" | |
| ] | |
| } | |
| } |
The root logger uses a separate root key (source), so the correct JSON would be
"loggers": {},
"root": {
"level": "DEBUG",
"handlers": [
"stderr",
"file"
]
}(the empty "loggers" key can probably be skipped).
carlosdavila91, shellydavid, Arshitha, aka-phrankie, harkabeeparolus and 1 more
Metadata
Metadata
Assignees
Labels
No labels