Skip to content

Tag: logging

How to get all previous logs written during current run (python logging)

I’m using the python logging module. How can I get all of the previously outputted logs that have been written-out by logger since the application started? Let’s say I have some large application. When the application first starts, it sets-up logging with something like this A few hours or days later I want to be able to get the history

Prevent one of the logging handlers for specific messages

I monitor my script with the logging module of the Python Standard Library and I send the loggings to both the console with StreamHandler, and to a file with FileHandler. I would like to have the option to disable a handler for a LogRecord independantly of its severity. For example, for a specific LogRecord I would like to have the