Skip to content
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

867 shortenedthrowableconverter truncate stacktrace based on regex pattern #874

Conversation

brenuart
Copy link
Collaborator

No description provided.

Truncate the stacktrace after the first line matching the configured `truncatAfter` regex patterns is found.
Different JDK are producing stacktraces of different length -> make the test dynamic and do not assume the length of the stacktrace is fixed and known up-front.
Also, allows to use `-1` to disable features like `maxLength`, `maxNumberThrowable` and `shortenedClassNameLength` instead of having to use Integer.MAX which is hard to remember when writing the XML configuration.
@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Merging #874 (5553ef6) into main (cccd368) will increase coverage by 0.34%.
The diff coverage is 77.77%.

@@             Coverage Diff              @@
##               main     #874      +/-   ##
============================================
+ Coverage     71.24%   71.58%   +0.34%     
- Complexity     1284     1309      +25     
============================================
  Files           170      170              
  Lines          4869     4910      +41     
  Branches        508      514       +6     
============================================
+ Hits           3469     3515      +46     
+ Misses         1148     1147       -1     
+ Partials        252      248       -4     
Impacted Files Coverage Δ
...ogback/stacktrace/ShortenedThrowableConverter.java 82.29% <77.77%> (+4.55%) ⬆️
...ogstash/logback/stacktrace/StackElementFilter.java 92.30% <0.00%> (+7.69%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@brenuart brenuart merged commit 9833bd7 into main Oct 11, 2022
@brenuart brenuart deleted the 867-shortenedthrowableconverter-truncate-stacktrace-based-on-regex-pattern branch October 11, 2022 12:55
@brenuart brenuart linked an issue Oct 11, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants