Skip to content

Integration with Uvicorn example can not run #87

@ahaooahaz

Description

@ahaooahaz

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions