Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.