-
Notifications
You must be signed in to change notification settings - Fork 383
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
Improvements to logging in mdmproxy #20201
base: main
Are you sure you want to change the base?
Conversation
zwass
commented
Jul 3, 2024
- Add --debug flag to log Fleet requests and responses
- Add --log-skipped flag to disable logging most garbage requests by default
- Add --debug flag to log Fleet requests and responses - Add --log-skipped flag to disable logging most garbage requests by default
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!
strings.Contains(r.URL.Path, ".py") || | ||
strings.Contains(r.URL.Path, "wp-") || | ||
strings.Contains(r.URL.Path, "private") || | ||
(r.URL.Path == "/" && r.Method == http.MethodPost) |
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.
if we find out this is not enough, we could also skip requests that don't contain Content-Type: application/x-apple-aspen-mdm-checkin
or Content-Type: application/x-apple-aspen-mdm
} | ||
r.Body = io.NopCloser(bytes.NewReader(b)) | ||
|
||
log.Println("Fleet response: ", string(b)) |
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.
should we print any extra information here? worried about the logs being harder to distinguish with multiple concurrent requests.
guessing this is just for staging testing with very few devices so not a concern, feel free to ignore if so
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #20201 +/- ##
==========================================
- Coverage 62.65% 55.20% -7.45%
==========================================
Files 1405 1409 +4
Lines 131562 132012 +450
Branches 3216 3216
==========================================
- Hits 82429 72878 -9551
- Misses 42810 53198 +10388
+ Partials 6323 5936 -387
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |