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

Response code logging tweaks - different log levels for success, redi… #427

Merged
merged 6 commits into from Jul 31, 2018

Conversation

Projects
None yet
4 participants
@scypio
Contributor

scypio commented Jun 29, 2018

…rect and error responses

Currently every response from repository that return HTTP status code different than 200 is logged using ERROR logger level. The strategy has been adjusted.

Description

2xx - success - log at debug
3xx - redirect - log at info
4xx - client error - log at warn
5xx - server error - log at error
other - log at warn

#423

Motivation and Context

Too many error messages may trigger unwanted warnings for devops. Error log level should indicate that something is wrong.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the Knot.x Contributor License Agreement.

@Skejven

Skejven approved these changes Jul 2, 2018

@Skejven

This comment has been minimized.

Show comment
Hide comment
@Skejven

Skejven Jul 2, 2018

Contributor

Thank you @scypio for this fix.

Contributor

Skejven commented Jul 2, 2018

Thank you @scypio for this fix.

scypio added some commits Jul 2, 2018

Update HttpRepositoryConnectorProxyImpl.java
HTTP status code logging tweaks - PR changes
Update HttpRepositoryConnectorProxyImpl.java
Http status logging tweaks  - typo fixed
@mateuszgrab-cognifide

This comment has been minimized.

Show comment
Hide comment
@mateuszgrab-cognifide

mateuszgrab-cognifide Jul 2, 2018

Would it be possible to add information about requested resource while logging response?
The issue I have is that it makes no sense in some cases to log every request, however it is good to know what resource was requested if there was >= 400 response code.

mateuszgrab-cognifide commented Jul 2, 2018

Would it be possible to add information about requested resource while logging response?
The issue I have is that it makes no sense in some cases to log every request, however it is good to know what resource was requested if there was >= 400 response code.

@Skejven

This comment has been minimized.

Show comment
Hide comment
@Skejven

Skejven Jul 2, 2018

Contributor

What do you think about adding request path (especially in warn and error level) in the message?
I think that might be useful.

Contributor

Skejven commented Jul 2, 2018

What do you think about adding request path (especially in warn and error level) in the message?
I think that might be useful.

@scypio

This comment has been minimized.

Show comment
Hide comment
@scypio

scypio Jul 2, 2018

Contributor

@Skejven @mateuszgrab-cognifide I added request URL logging for 4xx, 5xx response codes

Contributor

scypio commented Jul 2, 2018

@Skejven @mateuszgrab-cognifide I added request URL logging for 4xx, 5xx response codes

@Skejven Skejven merged commit 372ab5d into Cognifide:master Jul 31, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment