-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Suppressing the KeyError for an unbind() call #171
Comments
I don’t think silencing errors is a good plan, but I may be open to add something like Unrelatedly you mentioned you deployed structlog in a Django app…would you mind to contribute some wisdom how you did it? I haven’t used Django in years but people keep mentioning, that they’d like examples of that. |
Sure thing. Would you like me to jot down some notes in the comments here or in a separate doc? |
I think it would be the easiest for everybody if you just opened a bug “Add integration information for Django" and dump whatever you‘re comfortable to share there. Then we can start thinking how to structure it and where to put it! |
Cool. Will do so by end of this week. |
|
Added a document here: #175 |
Hi,
This is a suggestion for possible improvement in the logic of invoking the
unbind()
method on theBoundLogger
. We recently deployedstructlog
in our Django project. Everything seemed to work fine until we started getting a bunch ofKeyError
s while unbinding parameters.We realised that we had a recursive logic where on a child stack the context variable would get unbound and when the control came back to the parent stack, another call to unbind crashed the flow.
For now, we added a new wrapper class over the
BoundLogger
which simply suppresses the exception:Just wanted to check whether doing this might have any unwanted consequences.
Thanks for this wonderful library!
The text was updated successfully, but these errors were encountered: