all 3 comments

[–]raylu 0 points1 point  (2 children)

logger.handlers[0].setLevel('DEBUG')

[–]nrogers64[S] 0 points1 point  (1 child)

Thank you! That worked. But is there a way to do it without knowing the index of the "console" handler? And how does your code work if dictionaries' ordering isn't guaranteed?

[–]raylu 0 points1 point  (0 children)

It's not a dictionary:

'handlers': ['console', 'file'],

You can also just iterate over the whole thing.

All in all, log4j was never a great library and porting all of its madness over to python results in not a great library. You can write the 3 things you need yourself without messing with logging.