logging.basicConfig throwing ValueError Unrecognised arguments
logging.basicConfig(filename=’example.log’, level=logging.DEBUG, encoding=’utf-8′) When I try the above code I get this error File “/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/logging/__init__.py”, line 2009, in basicConfig raise ValueError(‘Unrecognised argument(s): %s’ % keys) ValueError: Unrecognised argument(s): encoding I tried going through the docs only to find that encoding is a valid argument for basicConfig(). Can someone explain? python logging python-logging New contributor prat2194 […]
Should I use Python inbuilt logging module for structured JSON logging or choose a third party library?
I am trying to log messages in Python in a structured JSON format. When I investigated the available options I found some of the below. However, I found multiple blogs suggesting using the inbuilt logging module with a custom JSON formatter is sufficient.
As all these options just logging the message in a JSON format, I am just thinking that the advantage of using third party library is that if there any standards change then upgrading the library version should be sufficient with out change in the code. Please advise.