The error issue from #1672 was resolved in #1742; however, the log levels should properly be set when --debug
is set with the CLI.
# mcve.py
from litestar import Litestar, get, Request
from litestar.logging import StructLoggingConfig
@get("/")
def hello_world(request: Request) -> dict[str, str]:
"""Keeping the tradition alive with hello world."""
request.logger.info("info inside a request")
request.logger.debug("debug inside a request")
return {"hello": "world"}
app = Litestar(
route_handlers=[hello_world],
logging_config=StructLoggingConfig(),
)
1. Create MCVE file, e.g. mcve.py
2. Run the file `litestar run --debug --app "mcve.py"`
3. Browse to `http://localhost:8000`
4. Observe that `request.logger.debug("debug inside a request")` is within the expected log filter level but is not logged.
No response
No response
2.0a7
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too