11

My Situation
There may be one or more configured loggers, but I don't know what their names are.

Requirement
For testing purposes, I need to reconfigure logging handlers that were previously configured to log to stdout with a different format and logging level.

  1. [caveat] I already know how to clear one handler.
  2. [caveat] I would prefer stdlib over 3rd-party libs (pypi, github, et al).
Community
  • 1
  • 1
bitcycle
  • 7,374
  • 14
  • 67
  • 120

1 Answers1

15
print (logging.Logger.manager.loggerDict.keys())

found by digging the sources of logging package

plaes
  • 30,266
  • 10
  • 85
  • 86
nosklo
  • 205,639
  • 55
  • 286
  • 290