-
Notifications
You must be signed in to change notification settings - Fork 118
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
Provide a way to log successful and failed requests #719
base: main
Are you sure you want to change the base?
Conversation
Motivation: TBU Modifications: TBU Result: Logging configuration example: ```json { "targetGroups": [ "API", "HEALTH" ], "loggerName": "centraldogma.test", "requestLogLevel": "DEBUG", "successfulResponseLevel": "DEBUG", "failureResponseLevel": "ERROR", "successSamplingRate": 0.4, "failureSamplingRate": 0.6 } ```
Codecov Report
@@ Coverage Diff @@
## master #719 +/- ##
============================================
+ Coverage 70.31% 70.40% +0.08%
- Complexity 3418 3444 +26
============================================
Files 349 351 +2
Lines 13470 13565 +95
Branches 1454 1466 +12
============================================
+ Hits 9472 9550 +78
- Misses 3139 3153 +14
- Partials 859 862 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
logHealthCheck = true; | ||
logMetrics = true; | ||
} else { | ||
for (RequestLogGroup logGroup : requestLogGroups) { |
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.
Question: Is it possible that users may want to configure different logging parameters for different paths?
e.g.
- METRIC: debug
- API: info
- ...
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.
Oh... It is so nice! 👍
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.
We can implement it by adding different LoggingService
s.
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! Left some suggestions. 😄
|
||
private final Set<RequestLogGroup> targetGroups; | ||
|
||
private final LogLevel requestLogLevel; |
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.
Shouldn't we allow to set different settings per RequestLogGroup
?
logHealthCheck = true; | ||
logMetrics = true; | ||
} else { | ||
for (RequestLogGroup logGroup : requestLogGroups) { |
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.
How about also supporting the specified path? e.g. /api/v1
|
Motivation:
To diagnose an exception error on the client-side, request logs are important to check request parameters, response duration and application errors.
Modifications:
RequestLogConfig
which can limit the sampling rate, adjust target groups, and set the logging levels.TransientServiceOption.WITH_SERVICE_LOGGING
is specified toHealthCheckService
orPrometheusExpositionService
if
METRICS
orHEALTH
group is defined inRequestLogConfig
Result:
LoggingService
in Central Dogma server #718