Bug: Unexpected logger behaviour. Unable to use build-in default logger in Litestar #3913
Open
2 of 4 tasks
Labels
Bug 🐛
This is something that is not working as expected
Description
Hi,
I am currently using Litestar for my new services. And after FastAPI I can't get the logger to work correctly.
First. During development we use std readable custom logs. And on the server we use json logs. I didn't find this fix in the documentation in sours, I guess it's not there. Additional mention of this issue.
Second. After several tests with Litestar, I could not jam your default logger. Using a custom logger based on the default logger, where clear formatters, logging levels, handlers, and interceptors are defined, it doesn't want to work as I expect it to work in litestar as it does in other parts of the service(s).
For example, when doing local development during an exception I expect to get an expanded log of my pattern, but instead I get the default Litestar log.
P.S. I'm not sure if it's a bug or a feature, but in that case I'd suggest considering stopping your default logger initialization or accepting a pre-created and prepared users' logger, as is done in the Faststream framework.
URL to code causing the issue
No response
MCVE
Steps to reproduce
Screenshots
Logs
Litestar Version
Version: "litestar==2.13.0",
Platform
The text was updated successfully, but these errors were encountered: