Managing propagation rules
The default behavior for Loggers is for a logging record to propagate from the named Logger up through all parent-level Logger instances to the root Logger instance. We may have lower-level Loggers that have special behaviors and a root Logger that defines the default behavior for all Loggers.
Because logging records propagate, a root-level logger will also handle any log records from the lower-level Loggers that we define. If child loggers allow propagation, this will lead to duplicated output: first, there will be output from the child, and then the output when the log record propagates to the parent. If we want to avoid duplication, we must turn the propagation off for lower-level loggers when there are handlers ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access