-
-
Notifications
You must be signed in to change notification settings - Fork 225
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
to_repr
and rich
breaks logging
#655
Comments
Do you install |
I checked which modules are installed on the server and neither |
Thank you! 💛
What you mean here, is that you expect single-line JSON lines and Rich formating breaks them into multiple ones? (is this expected @sscherfke?)
I don't think that's a hot fix – I think you're using configuration as it's intended? 😅
Not to be lecturing, but you should use recursive lock files to make this deterministic. 🤓
We try to avoid having anything global except the configuration and you were able to work around the problem using regular config, so I'm gonna say everything is working as intended? Depending on what Stefan says, we can have a look at multi-line log lines or whatever is happening there, but adding a global variable to avoid configuration is not our MO. :) |
Structlog version: 24.4.0
Hello,
Maybe this is just bad setup on our end, but it was tricky to figure out so I decided to raise it.
We use
structlog
for logging data from our service in json format, and then uploading it intoDataDog
. After updating structlog to version24.4.0
our logging started to break each time we logged an exception (structlog.get_logger().exception(...)
)I was able to trace the root cause to this PR: #627, where the implementation for
to_repr
changed to:and I was able to hotfix the the problem on our end by creating our own
dict_tracebacks
and settinguse_rich
explicitly.Stack Trace
Since we don't install
rich
on the server, I'm not really sure how it was able to import it in the first place (my guess is transitive dependency), or why it failed.But would it make sense to somehow configure the
use_rich
flag globally?The text was updated successfully, but these errors were encountered: