#Configuring Uvicorn as started by "litestar run" to use structlog?

1 messages · Page 1 of 1 (latest)

livid leaf
#

The structlog plugin works for well for most purposes -- but that doesn't extend to uvicorn itself, which despite having configuration that wraps both stdlib and structlog loggers with JSON, is emitting plain text.

In the pre-Litestar world, I used hypercorn --config ... to run my application with configuration from an arbitrary Python module. Now that I'm using litestar --app ... run, is there some equivalent?

meager shoalBOT
#
Notes for Configuring Uvicorn as started by "litestar run" to use structlog?
At your assistance

@livid leaf

No Response?

If no response in a reasonable time, ping @Member.

Closing

To close, type !solve or byte solve.

MCVE

Please include an MCVE so that we can reproduce your issue locally.

orchid charmBOT
#

src/app/config/app.py lines 89 to 98

"uvicorn.access": {
    "propagate": False,
    "level": settings.log.UVICORN_ACCESS_LEVEL,
    "handlers": ["queue_listener"],
},
"uvicorn.error": {
    "propagate": False,
    "level": settings.log.UVICORN_ERROR_LEVEL,
    "handlers": ["queue_listener"],
},