-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use PositionalArgumentsFormatter with FilteringBoundLogger #439
Comments
This will need a bit more thought, perhaps |
I think I need more context here – how did you manage to make gunicorn use make_filtering_bound_logger? The whole point of it is to have very fast level filters if you don't use stdlib, which has level filters built in? |
Gunicorn allows you to specify a logger class to use: https://docs.gunicorn.org/en/stable/settings.html#logger-class, so by adapting it similar to what I found in this gist, I was able to have Gunicorn log with a structlog logger. However, I can't control how gunicorn calls their logger, and they still interface with it as if it was a stdlib logger. |
hey sorry for the delay – would you mind checking if #454 fixes this? |
Thanks, I haven't had a chance to fully test it but looking at the code, it looks like it should work! 🎉 |
@hynek Can I ask one small question? When this changes will be available? Just approximately 😉 |
The 22.2 is largely feature-complete, but I need to tie up a few strings in documentation (notably add a Celery recipe) and a bit of admin work. Shouldn't be too long, since I want it out too, but can't commit to a date. |
I was switching to using
make_filtering_bound_logger
when I noticed that using a custom Gunicorn logger (that basically maps to structlog logging) wasn't working anymore. The issue is that the logger is doing something likelog.info("Starting gunicorn %s", __version__)
which then caused an error:I can open a PR to simply pass through
*args
as well (in the level andlog
methods) which should clear up the error, though I don't know if this could cause downstream issues.The text was updated successfully, but these errors were encountered: