-
Notifications
You must be signed in to change notification settings - Fork 927
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
Fix where access log is not written when the method of a reques… #2159
Conversation
…ot allowed Motivation: There's some cases that we don't call `RequestLogBuilder.endRequest()`. - When the method of the request is not allowed - When there's no services that match the path of the request - and so on Because the `RequestLog` in never complete, `AccessLogWriter` is not called so we should fix it. Modifications: - Call `RequestLogBuilder.endRequest()` even when `service.serve()` is not invoked Result: - You can now see the access logs when the method of a request is not allowed and there's no services that match the path.
} | ||
|
||
@Test | ||
void httpStatusException() { |
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.
I found out that we leave the httpStatusException
as the cause but not for httpResponseException
.
I think we should treat them in the same way and I feel we do not need to log the causes in both cases.
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.
Agreed. Could you update accordingly?
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.
Fixed. PTAL 🙇
Codecov Report
@@ Coverage Diff @@
## master #2159 +/- ##
============================================
- Coverage 73.59% 73.52% -0.07%
+ Complexity 9571 9566 -5
============================================
Files 837 837
Lines 36836 36856 +20
Branches 4543 4547 +4
============================================
- Hits 27108 27098 -10
- Misses 7402 7433 +31
+ Partials 2326 2325 -1
Continue to review full report at Codecov.
|
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!
} | ||
|
||
@Test | ||
void httpStatusException() { |
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.
Agreed. Could you update accordingly?
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.
LGTM :-)
@ikhoon Still LGTY? |
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.
Still LGTM, Sorry for the late review. 😢
Thanks for reviewing! 😉 |
…e#2159) …t is not allowed Motivation: There's some cases that we don't call `RequestLogBuilder.endRequest()`. - When the method of the request is not allowed - When there's no services that match the path of the request - and so on Because the `RequestLog` in never complete, `AccessLogWriter` is not called so we should fix it. Modifications: - Call `RequestLogBuilder.endRequest()` even when `service.serve()` is not invoked - Do not log HttpStatusException as requestCause Result: - You can now see the access logs when the method of a request is not allowed and there are no services that match the path.
…e#2159) …t is not allowed Motivation: There's some cases that we don't call `RequestLogBuilder.endRequest()`. - When the method of the request is not allowed - When there's no services that match the path of the request - and so on Because the `RequestLog` in never complete, `AccessLogWriter` is not called so we should fix it. Modifications: - Call `RequestLogBuilder.endRequest()` even when `service.serve()` is not invoked - Do not log HttpStatusException as requestCause Result: - You can now see the access logs when the method of a request is not allowed and there are no services that match the path.
…t is not allowed
Motivation:
There's some cases that we don't call
RequestLogBuilder.endRequest()
.Because the
RequestLog
in never complete,AccessLogWriter
is not called so we should fix it.Modifications:
RequestLogBuilder.endRequest()
even whenservice.serve()
is not invokedResult: