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

Use the default settings for Logging{Client,Service}'s default fact… #2855

Merged
merged 4 commits into from Jul 1, 2020

Conversation

trustin
Copy link
Member

@trustin trustin commented Jun 30, 2020

…ory methods

Motivation:

So far, Logging{Client,Service}.newDecorator() had different settings
than Logging{Client,Service}.builder().newDecorator() due to backward
compatibility. It's time to change this in favor of consistency.

Modifications:

  • Change the default logging level for successful requests and responses
    from TRACE to DEBUG.
  • Change Logging{Client,Service}.newDecorator() to use its builder's
    default settings.
    • DEBUG level logging for successful requests and responses.
    • WARN level logging for failed requests and responses`.

Result:

…ory methods

Motivation:

So far, `Logging{Client,Service}.newDecorator()` had different settings
than `Logging{Client,Service}.builder().newDecorator()` due to backward
compatibility. It's time to change this in favor of consistency.

Modifications:

- Change `Logging{Client,Service}.newDecorator()` to use its builder's
  default settings.
  - `TRACE` level logging for successful requests and responses.
  - `WARN` level logging for failed requests and responses`.

Result:

- Consistency
- Fixes line#2696
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

Nice!

@trustin
Copy link
Member Author

trustin commented Jun 30, 2020

By the way, is TRACE level the right default for successful requests and responses? I was rather expecting DEBUG or INFO. Do you remember why we lowered to TRACE? /cc @imasahiro @kojilin @anuraaga

@minwoox
Copy link
Member

minwoox commented Jun 30, 2020

I don't remember but DEBUG is fine with me.

@ikhoon
Copy link
Contributor

ikhoon commented Jun 30, 2020

Actually, I'm leaning towards INFO.😆 Because the request logs are generated from Logging{Client,Service} and users can easily turn it off using logging frameworks XML configuration.

@ikhoon
Copy link
Contributor

ikhoon commented Jun 30, 2020

@trustin
Copy link
Member Author

trustin commented Jun 30, 2020

Let me change the default level from TRACE to DEBUG tomorrow. Please feel free to let me know if you have any concern.

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #2855 into master will decrease coverage by 0.10%.
The diff coverage is 65.78%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2855      +/-   ##
============================================
- Coverage     72.83%   72.72%   -0.11%     
- Complexity    12167    12168       +1     
============================================
  Files          1079     1080       +1     
  Lines         47283    47321      +38     
  Branches       5896     5896              
============================================
- Hits          34438    34415      -23     
- Misses         9817     9887      +70     
+ Partials       3028     3019       -9     
Impacted Files Coverage Δ Complexity Δ
...eria/client/circuitbreaker/CircuitBreakerRule.java 42.85% <16.66%> (-7.15%) 11.00 <1.00> (ø)
...a/com/linecorp/armeria/client/retry/RetryRule.java 66.66% <33.33%> (-3.04%) 17.00 <1.00> (+1.00) ⬇️
.../circuitbreaker/CircuitBreakerRuleWithContent.java 35.71% <50.00%> (-4.29%) 7.00 <2.00> (ø)
...armeria/client/AbstractRuleWithContentBuilder.java 53.84% <60.00%> (-9.80%) 7.00 <1.00> (ø)
...m/linecorp/armeria/client/AbstractRuleBuilder.java 74.54% <61.11%> (-12.13%) 23.00 <5.00> (+2.00) ⬇️
...orp/armeria/client/retry/RetryRuleWithContent.java 71.42% <66.66%> (-0.58%) 12.00 <1.00> (+1.00) ⬇️
...tbreaker/CircuitBreakerRuleWithContentBuilder.java 63.41% <71.42%> (-6.03%) 18.00 <6.00> (+1.00) ⬇️
...eria/client/retry/RetryRuleWithContentBuilder.java 75.00% <71.42%> (-7.06%) 24.00 <10.00> (+1.00) ⬇️
...ient/circuitbreaker/CircuitBreakerRuleBuilder.java 80.00% <75.00%> (-7.10%) 20.00 <3.00> (+1.00) ⬇️
...linecorp/armeria/client/logging/LoggingClient.java 100.00% <100.00%> (ø) 3.00 <1.00> (ø)
... and 19 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 de25688...e30f442. Read the comment docs.

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.

Still LGTM

@trustin trustin merged commit 1e131c6 into line:master Jul 1, 2020
@trustin trustin deleted the logging_default_behavior branch July 1, 2020 06:56
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
line#2855)

…ory methods

Motivation:

So far, `Logging{Client,Service}.newDecorator()` had different settings
than `Logging{Client,Service}.builder().newDecorator()` due to backward
compatibility. It's time to change this in favor of consistency.

Modifications:

- Change the default logging level for successful requests and responses
  from `TRACE` to `DEBUG`.
- Change `Logging{Client,Service}.newDecorator()` to use its builder's
  default settings.
  - `DEBUG` level logging for successful requests and responses.
  - `WARN` level logging for failed requests and responses`.

Result:

- Consistency
- Fixes line#2696
- (Breaking) The default logging level for successful requests and response
  has been changed:
  - `INFO` to `DEBUG` for `Logging{Client,Service}.newDecorator()`
  - `TRACE` to `DEBUG` for `Logging{Client,Service}Builder`
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.

Logging decorator factories should match semantics of empty builder
3 participants