multiprocessing-logging
multiprocessing-logging copied to clipboard
exc_info missing on record
Hi @jruere,
I notice the library stringifies the exception info into exc_text, then clears the exc_info property.
This causes issues because the handler I'm using (AzureLogHandler) requires the exc_info property to determine the record was an exception. I understand why the exc_info property is cleared, but could it be possible to potentially parse the exc_text back into exc_info before submitting it to the sub_handler?
Thanks
I solved it using tblib. It allows the pickling of exceptions. If I call it right before the exception gets send, I don't need to clear exc_info.
if record.exc_info:
pickling_support.install(record.exc_info[1])
self.format(record)
I'll look into tblib but bear in mind I'm very slow in working on this project.
No worries, I copied and adapted the solution for my case. Just leaving this for posterity and in case you'd like to upgrade this library!