Closed kpetersen-rgare closed 1 year ago
Hi @kpetersen-rgare! Thanks for the report. We have squashed a few bugs around structlog issues and we should backport these.
edited: I am a bad reader and shouldnt answer issues so late 🙃
Hey, thanks for the quick response. I realized a simple workaround is to create my own structlog config class from the BaseLoggingConfig
class that does not inherit from pydantic's BaseModel
:
class MyStructLoggingConfig(BaseLoggingConfig):
def configure(self) -> "GetLogger":
structlog.configure(
processors=processors,
wrapper_class=structlog.make_filtering_bound_logger(logging.DEBUG),
logger_factory=logger_factory,
)
return structlog.get_logger
@JacobCoffee can you take this one?
Hi yes, I will look into this starting tonight
Description
When trying to hook up structlog to starlite v1.51.12, I got the Pydantic exception below on starting up the app. I tried the same with the litestar v2 beta hello-world app, and it worked. I realize this may not get fixed in v1.51.x. Is there a suggested workaround?
URL to code causing the issue
https://github.com/kpetersen-rgare/litestar-hello-world/blob/structlog-logging-config-bug/main.py
MCVE
Steps to reproduce
Screenshots
Logs
Litestar Version
1.51.12
Platform
Funding