Is there a way in python to get the list all defined loggers?
I mean, does something that can be used like logging.getAllLoggers()
and which would return a list of Logger objects exist?
I searched the python.logging documentation but couldn't find such a method.
Thank you in advance.
Loggers are held in a hierarchy by a
logging.Manager
instance. You can interrogate themanager
on the root logger for the loggers it knows about.Calling
getLogger(name)
ensures that any placeholder loggers held byloggerDict
are fully initialized when they are added to the list.