Relative Content

Tag Archive for pythonlogging

Can someone explain the ‘levels’ in the Python Logging module and whether Loggin can be setup in a def function?

I am fairly new to Python and now trying to use Logging rather that Print to follow and debug my code. The problem is that I am trying to setup Logging parameters using a def inline function and it is not working. I am using def because the parameter list is long and can be reused.
However by trial and error (definitely not by understanding!) I find that the following code works:

Python logger compressed Time Rotating is possible?

I need my program to write a new log file every day, and so far, that’s no problem. However, I also want the files to be compressed once they are written and limited to, for example, 7 compressed files. My only doubt is whether the logger provides a method for automatic compression without having to implement it manually.

Custom value in logging_config dict python

I made a bot python app using selenium and I mostly use logging for selenium logs. I want to add my own variable into formatter but I can’t do it on my own. I was searching internet, trying different things but I always do something wrong and always get ValueError: Formatting field not found in record: 'username' error. I just want to add inGame username to the output.