File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -651,6 +651,22 @@ You can see that the config file approach has a few advantages over the Python
651651code approach, mainly separation of configuration and code and the ability of
652652noncoders to easily modify the logging properties.
653653
654+ .. warning :: The :func:`fileConfig` function takes a default parameter,
655+ ``disable_existing_loggers ``, which defaults to ``True `` for reasons of
656+ backward compatibility. This may or may not be what you want, since it
657+ will cause any loggers existing before the :func: `fileConfig ` call to
658+ be disabled unless they (or an ancestor) are explicitly named in the
659+ configuration. Please refer to the reference documentation for more
660+ information, and specify ``False `` for this parameter if you wish.
661+
662+ The dictionary passed to :func: `dictConfig ` can also specify a Boolean
663+ value with key ``disable_existing_loggers ``, which if not specified
664+ explicitly in the dictionary also defaults to being interpreted as
665+ ``True ``. This leads to the logger-disabling behaviour described above,
666+ which may not be what you want - in which case, provide the key
667+ explicitly with a value of ``False ``.
668+
669+
654670.. currentmodule :: logging
655671
656672Note that the class names referenced in config files need to be either relative
Original file line number Diff line number Diff line change @@ -49,9 +49,22 @@ listed below.
4949Logger Objects
5050--------------
5151
52- Loggers have the following attributes and methods. Note that Loggers are never
52+ Loggers have the following attributes and methods. Note that Loggers are never
5353instantiated directly, but always through the module-level function
54- ``logging.getLogger(name) ``.
54+ ``logging.getLogger(name) ``. Multiple calls to :func: `getLogger ` with the same
55+ name will always return a reference to the same Logger object.
56+
57+ The ``name `` is potentially a period-separated hierarchical value, like
58+ ``foo.bar.baz `` (though it could also be just plain ``foo ``, for example).
59+ Loggers that are further down in the hierarchical list are children of loggers
60+ higher up in the list. For example, given a logger with a name of ``foo ``,
61+ loggers with names of ``foo.bar ``, ``foo.bar.baz ``, and ``foo.bam `` are all
62+ descendants of ``foo ``. The logger name hierarchy is analogous to the Python
63+ package hierarchy, and identical to it if you organise your loggers on a
64+ per-module basis using the recommended construction
65+ ``logging.getLogger(__name__) ``. That's because in a module, ``__name__ ``
66+ is the module's name in the Python package namespace.
67+
5568
5669.. class :: Logger
5770
You can’t perform that action at this time.
0 commit comments