I’m working with an application where just about every module and every class emits logging messages.
I need a way to capture every single one of those messages without explicitly attaching a handler via .addHandler() to each logging instance (which is what I’m doing right now).
Is there any way to attach a handler to every logging instance at once?
logginguses a hierarchy of loggers. Add a handler to the root logger and it will receive logged messages from child loggers, too.To access the root logger use
logging.getLogger().