-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Log statements with stack trace get truncated due to Logstash 8 KB limit #3364
Comments
@gmarziou, I think I solved the issue. First, I did some test by creating a super long stacktrace. Like that:
That's because, although your "reproduce the error" example is enough to get the jsonparse failure in logstash but it does not simulate the real case correctly as it's the log message that is too long not the stacktrace itself. Then as is proposed in the docs, I defined a `ShortenedThrowableConverter| with setMaxLength(7500) and as expected it's fixing the jsonparsefailure in logstash ! I chose a 7500 bytes stacktrace limit as the 8K limit is for the full log (stacktrace + other fields). |
Well truncating the stack trace will avoid the JSON error but it will not help people trying to debug their app as the root cause will be missing. That's why I was thinking of combining truncation and root first.
|
BTW, I got such deeply nested exception from a ribbon timeout on a gateway. |
Sorry, I'm just seing your reply now. I will run some tests to see if adding rootFirst helps. Your idea is good ! If this works, I don't see a problem to have the root cause first, it would be an improvement. |
…ace-length add a length limit for logstash-encoder forwarded stacktraces fix #3364
Overview of the issue
When app logs an exception stack trace and the JSON encoded log statement is larger than 8 KB, Logstash is confused and truncate the statement resulting in invalid JSON fragment.
This limit is the default one in Logstash: elastic/logstash#1505
Motivation for or Use Case
Logs with exceptions are very important and should contain all required info for investigation while possibly optimizing the volume of data transferred to Logstash.
JHipster Version(s)
3.0 master
Reproduce the error
Log an error with very long text and exception:
Suggest a Fix
logstash-logback-encoder has few options to limit stack trace depth.
In particular, the rootFirst option which prints the root cause first could be combined with maxLength in bytes.
The text was updated successfully, but these errors were encountered: