0

I am using the below logging file and load it via fileConfig. I would like to configure the logging behavior of modules that are imported. For example, I want to disable (or set it to some higher log level) logging from urllib3. How would I do that?

[loggers]
keys = root

[logger_root]
level = DEBUG
handlers = root

[handlers]
keys = root

[handler_root]
class = StreamHandler
level = DEBUG
formatter = json

[formatters]
keys = json

[formatter_json]
format = %(name)s%(message)s%(asctime)s%*(levelname)s%*(module)s
class = pythonjsonlogger.jsonlogger.JsonFormatter

1 Answer 1

1

Change your configuration to something like (these are just additions/changes to you what you posted):

[loggers]
keys = root,urllib3

[logger_urllib3]
level=CRITICAL
handlers=root
qualname=urllib3
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.