asgi-correlation-id icon indicating copy to clipboard operation
asgi-correlation-id copied to clipboard

Integration with Uvicorn example can not run

Open ahaooahaz opened this issue 10 months ago • 0 comments

python version: 3.8.16 traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/config.py", line 698, in add_filters
    filterer.addFilter(self.config['filters'][f])
  File "/usr/lib/python3.8/logging/config.py", line 324, in __getitem__
    value = dict.__getitem__(self, key)
KeyError: <asgi_correlation_id.log_filters.CorrelationIdFilter object at 0x7fad412e09a0>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/config.py", line 563, in configure
    handler = self.configure_handler(handlers[name])
  File "/usr/lib/python3.8/logging/config.py", line 759, in configure_handler
    self.add_filters(result, filters)
  File "/usr/lib/python3.8/logging/config.py", line 700, in add_filters
    raise ValueError('Unable to add filter %r' % f) from e
ValueError: Unable to add filter <asgi_correlation_id.log_filters.CorrelationIdFilter object at 0x7fad412e09a0>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "main.py", line 36, in <module>
    uvicorn.run("test:app", port=8080, log_level=os.environ.get("LOGLEVEL", "DEBUG").lower())
  File "/home/zhanghao4/.local/lib/python3.8/site-packages/uvicorn/main.py", line 513, in run
    config = Config(
  File "/home/zhanghao4/.local/lib/python3.8/site-packages/uvicorn/config.py", line 272, in __init__
    self.configure_logging()
  File "/home/zhanghao4/.local/lib/python3.8/site-packages/uvicorn/config.py", line 364, in configure_logging
    logging.config.dictConfig(self.log_config)
  File "/usr/lib/python3.8/logging/config.py", line 808, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib/python3.8/logging/config.py", line 570, in configure
    raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'access'

ahaooahaz avatar Mar 25 '24 06:03 ahaooahaz