-
Notifications
You must be signed in to change notification settings - Fork 909
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 the exception while making request and response log strings. #3043
Conversation
Motivation: It's not easy to recognize what is the problem if an exception is raised while making request response log strings because there's no log for the exception and of course, request and response logs are not left as well. Modification: - Log the exception that is raised while making request response log strings. Result: - You can now get the log of the exception which is raised while making requst and response logs.
Codecov Report
@@ Coverage Diff @@
## master #3043 +/- ##
============================================
- Coverage 73.40% 73.36% -0.05%
- Complexity 12289 12290 +1
============================================
Files 1066 1066
Lines 47583 47615 +32
Branches 6001 6007 +6
============================================
+ Hits 34930 34934 +4
- Misses 9606 9627 +21
- Partials 3047 3054 +7 Continue to review full report at Codecov.
|
core/src/main/java/com/linecorp/armeria/internal/common/logging/LoggingDecorators.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/internal/common/logging/LoggingDecorators.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @minwoox !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops... I missed to approve this. 😅
Thanks! @minwoox
}) | ||
.build(delegate); | ||
loggingClient.execute(ctx, req); | ||
verify(logger).warn(eq("Unexpected exception while logging request: "), any(CompletionException.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify(logger).warn(eq("Unexpected exception while logging request: "), any(CompletionException.class)); | |
verify(logger).warn(contains("Unexpected exception while logging request: "), any(CompletionException.class)); |
This test was failed https://ci.appveyor.com/project/line/armeria/builds/35079753/job/5fn7wowbu1vdvwwf#L1498 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops forgot to fix the test. 🤣
Motivation:
It's not easy to recognize what is the problem if an exception is raised while making request and response log strings
because there's no log for the exception and of course, request and response logs are not left as well.
Modification:
Result: