Logging all uncaught exceptions

Chris Angelico rosuav at gmail.com
Mon Jul 14 11:21:44 CEST 2014


On Mon, Jul 14, 2014 at 7:07 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> but the exception info which should have been generated by
> mylogger.exception doesn't appear anywhere I can see.
>
>
> What am I doing wrong?

I'm not specifically familiar with the logging module, but something
I'd look at would be 'ls /var/log -lt|head' to see what files get
updated. (Works well with 'watch' - a file gets changed, it jumps up
to the top of the list.) Maybe the exceptions are going into a
different file (they go at the ERROR level, IIUI). If that doesn't
help: the exception method says "This method should only be called
from an exception handler", so I don't know if it uses magic to get
extra info. What happens if you explicitly use .debug() instead?

But you probably know a lot more about this than I do.

ChrisA



More information about the Python-list mailing list