This turned out to be a case of sloppy code. We had some hack elsewhere in the startup execution path that re-initialized the logging:
logging.root.removeHandler(logging.root.handlers[0]) # Undo previous basicConfig
logging.basicConfig(format='same long format',
level=logging.DEBUG)
However, since logging.basicConfig
doesn't do anything if logging.root
has existing handlers, this simply removed the stream handler, leaving the sentry handler, and caused basicConfig
to then act as no-op, meaning we lost our StreamHandler altogether.
Removing these lines and having only one basicConfig
and a setup_logging
call worked.