Ask Your Question
3

Why are aiohttp errors not being logged by the Python asyncio logger?

asked 2023-06-30 19:01:41 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-30 19:11:02 +0000

nofretete gravatar image

There could be several reasons why aiohttp errors are not being logged by the Python asyncio logger:

  1. Logging level is too high: If the logging level of the asyncio logger is set too high (e.g. logging.ERROR or logging.CRITICAL), it may not log lower level errors such as those generated by aiohttp. In this case, the logging level should be set to a lower value (e.g. logging.DEBUG).

  2. Logging configuration not set up properly: If the logging configuration is not set up properly, the asyncio logger may not be configured to log aiohttp errors. The logging configuration should ensure that the asyncio logger is set up and assigned to the appropriate handlers.

  3. Aiohttp errors are being caught and handled: If aiohttp errors are being caught and handled by the application code, they may not reach the asyncio logger. In this case, the application code should be modified to log the errors before handling them.

  4. Aiohttp errors are being logged to a different logger: If aiohttp errors are being logged to a different logger (e.g. aiohttp.client logger), they may not appear in the asyncio logger. In this case, the logging configuration should ensure that all relevant loggers are set up and assigned to appropriate handlers.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-30 19:01:41 +0000

Seen: 10 times

Last updated: Jun 30 '23