Limit length of log entries#4028
Conversation
c714c6f to
af7ce56
Compare
|
The failed test (generate unique slug) is unrelated to the PR. |
|
I already patched this onto the prod server to have a workaround for the long log messages. |
|
I'm not sure how I feel about adding this blanket solution here. I opened up a PR on linkcheck instead, this targets specifically the problematic log message, and specifically data URLs: DjangoAdminHackers/django-linkcheck#219 I'm not sure what to expect regarding when it will be merged and land in a release however |
|
We can increase the length to 10k chars or whatever. But truncating too long log entries is something that many programs do to prevent problems. |
PeterNerlich
left a comment
There was a problem hiding this comment.
Sounds good. I'm not sure about whether there is a better way than to just modify the RequestFormatter, but I have no good idea about how logging / django logging is supposed to work and at first glance it doesn't look like there is an easy way to chain formatters or something like that.
One note, if I remember correctly the 4096 will denote proper characters, not bytes, so the storage will still differ by line if some contain UTF characters. I don't think this is a problem though since our goal is to just keep the log file size from exploding
32e1b20 to
3be4564
Compare
Co-authored-by: Peter Nerlich <PeterNerlich@users.noreply.github.com>
3be4564 to
64e919f
Compare
Short description
We sometimes have log entries with multiple megabytes of base64 encoded images. This breaks reading logs.
Proposed changes
Limit log messages to 4096 characters.
Side effects
Faithfulness to issue description and design
There are no intended deviations from the issue and design.
How to test
Resolved issues
Pull Request Review Guidelines