-
Notifications
You must be signed in to change notification settings - Fork 129
Provide a way to log successful and failed requests #719
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
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #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 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| 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 LoggingServices.
minwoox
left a comment
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:
RequestLogConfigwhich can limit the sampling rate, adjust target groups, and set the logging levels.TransientServiceOption.WITH_SERVICE_LOGGINGis specified toHealthCheckServiceorPrometheusExpositionServiceif
METRICSorHEALTHgroup is defined inRequestLogConfigResult:
{ "targetGroups": [ "API", "HEALTH" ], "loggerName": "centraldogma.test", "requestLogLevel": "DEBUG", "successfulResponseLevel": "DEBUG", "failureResponseLevel": "ERROR", "successSamplingRate": 0.4, "failureSamplingRate": 0.6 }LoggingServicein Central Dogma server #718