0

I want set logging level of requests to logging.WARN only.

Most of time, logging.DEBUG works for me, but when I add requests to my project, requests log out too much.

I can simply just change the level to WARN globally, but then I miss many logs from others, I just want to turn off the logs of requests only?

Here is part of my logging.yaml:

handlers:

    console:
        class: logging.StreamHandler
        level: DEBUG
        formatter: colored
        stream: ext://sys.stdout
roger
  • 9,063
  • 20
  • 72
  • 119

1 Answers1

1

Define a logger for requests and use qualname to limit said logger to a certain channel:

loggers:
    requests:
        qualname: requests
        level: WARN
        handlers:
Ilja Everilä
  • 50,538
  • 7
  • 126
  • 127