Skip to content

Log propagation issue #312

@julianstirling

Description

@julianstirling

Describe the bug
Not all logs propagate to the root logger when serving with uvicorn.

In the OpenFlexure server we fix this by doing:

log_config = copy(uvicorn.config.LOGGING_CONFIG)
log_config["loggers"]["uvicorn"]["propagate"] = True
log_config["loggers"]["uvicorn.access"]["propagate"] = True

...

uvicorn.run(
    server.app,
    host=args.host,
    port=args.port,
    log_config=log_config,
    timeout_graceful_shutdown=2,
)

Note that log_config["loggers"]["uvicorn.access"]["propagate"] = True is a bit noisy, we filter out most of them when writing log files.

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