[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-11-13 Thread Jack_B
Jack_B added the comment: OK, I had a misunderstanding about what record.stack_info was. I see it is a string, so doesn't need to be stripped. Ignore my first con and the previous message. Sorry for the noise. -- ___ Python tracker

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-11-13 Thread Jack_B
Jack_B added the comment: Whoops! I've been a bit inconsistent between the code and my pros and cons about whether exc_text gets record.stack_info as well as record.exc_info. But either option is possible. As an aside, I'm not sure why stack info is not cached in e.g. record.stack_text for

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-11-13 Thread Jack_B
Jack_B added the comment: This also tripped me up recently. More broadly, I assumed that handlers downstream of the QueueHandler/QueueListener would get complete log records. Having looked at it, I can see they need to be pickled, and that means stripping some information. But like Mikael,

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-17 Thread Vinay Sajip
Vinay Sajip added the comment: It might be inadvisable to make your suggested change because of backward compatibility and breakage of existing code. However, I don't mind updating the logging cookbook to mention your suggested method of resolving the issue for this use case. I'll leave the

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Mikael Koli
Mikael Koli added the comment: I did subclass the QueueHandler and it did circumvent the issue for me. But after spending some time to find out why I could not access the exc_text I thought maybe there is something that could be done to make it more intuitive and save others' time. I find

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Vinay Sajip
Vinay Sajip added the comment: Why can you not subclass QueueHandler and override the prepare method to do what you want/need? -- ___ Python tracker ___

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +vinay.sajip, zach.ware versions: -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___ ___

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Mikael Koli
Mikael Koli added the comment: And the reason why overriding attribute 'record.msg' with the formatted message is problematic is that the method 'record.getMessage' (which is used by Formatter) fetches the log message from the variable 'record.msg'. Therefore the exc_text needs to be set to

[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Mikael Koli
New submission from Mikael Koli : The reason why logging.handlers.QueueHandler does not maintain exc_text is obvious: def prepare(self, record): ... record = copy.copy(record) record.message = msg record.msg = msg record.args = None