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).
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).https://github.com/mCodingLLC/VideosSampleCode/blob/b6fe3c808c9a31b0425fe9f2005420fdb1958f0f/videos/135_modern_logging/logging_configs/2-stderr-json-file.json#L39-L47
The root logger uses a separate
root
key (source), so the correct JSON would be(the empty
"loggers"
key can probably be skipped).