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

Log the exception while making request and response log strings. #3043

Merged
merged 4 commits into from
Sep 11, 2020

Conversation

minwoox
Copy link
Member

@minwoox minwoox commented Sep 3, 2020

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:

  • Log the exception that is raised while making request and response log strings.

Result:

  • You can now get the log of the exception which is raised while making request and response logs.

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.
@minwoox minwoox added this to the 1.0.1 milestone Sep 3, 2020
@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #3043 into master will decrease coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
.../armeria/client/logging/AbstractLoggingClient.java 97.22% <100.00%> (-0.08%) 3.00 <0.00> (ø)
...ria/internal/common/logging/LoggingDecorators.java 89.47% <100.00%> (+3.26%) 10.00 <3.00> (+3.00)
...inecorp/armeria/server/logging/LoggingService.java 100.00% <100.00%> (ø) 6.00 <0.00> (ø)
...n/java/com/linecorp/armeria/server/HttpServer.java 40.00% <0.00%> (-20.00%) 2.00% <0.00%> (-1.00%)
...inecorp/armeria/common/ClosedSessionException.java 54.54% <0.00%> (-18.19%) 5.00% <0.00%> (-1.00%)
...rmeria/internal/common/kotlin/ArmeriaKotlinUtil.kt 50.00% <0.00%> (-10.00%) 2.00% <0.00%> (-1.00%)
.../armeria/client/endpoint/dns/DnsEndpointGroup.java 76.56% <0.00%> (-4.69%) 12.00% <0.00%> (-3.00%)
...inecorp/armeria/server/grpc/ArmeriaServerCall.java 84.25% <0.00%> (-3.09%) 80.00% <0.00%> (+2.00%) ⬇️
...a/com/linecorp/armeria/common/util/Exceptions.java 39.86% <0.00%> (-2.80%) 30.00% <0.00%> (-1.00%)
...rp/armeria/internal/common/Http2GoAwayHandler.java 62.50% <0.00%> (-2.50%) 16.00% <0.00%> (-1.00%)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc7f432...9450a5e. Read the comment docs.

Copy link
Member

@trustin trustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @minwoox !

Copy link
Contributor

@ikhoon ikhoon left a 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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 😉

Copy link
Member Author

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. 🤣

@trustin trustin merged commit d673e70 into line:master Sep 11, 2020
@minwoox minwoox deleted the logging_exception branch September 14, 2020 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants