Migrate HTTP request logging from go-kit/log to slog (#39729)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #38889 

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.

## Testing

- [x] Added/updated automated tests
- [x] QA'd all new/changed functionality manually
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Updated internal logging infrastructure to improve standardization and
maintainability. Logging functionality remains unchanged from an
end-user perspective.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Victor Lyuboslavsky
2026-02-14 13:04:41 -06:00
committed by GitHub
parent 0ff707a316
commit de55ecf778
19 changed files with 94 additions and 80 deletions
+3 -2
View File
@@ -115,7 +115,8 @@ func (ts *WithServer) SetupSuite(t *testing.T, dbName string) {
logger := slog.New(slog.NewTextHandler(os.Stdout, nil))
kitLogger := logging.NewLogger(logger)
activityModule := activities.NewActivityModule(&ts.DS.DataStore, kitLogger)
svc, err := service.NewServiceWithClient(logger, &ts.DS, &ts.AndroidAPIClient, "test-private-key", ts.DS.Datastore, activityModule, config.AndroidAgentConfig{})
svc, err := service.NewServiceWithClient(logger, &ts.DS, &ts.AndroidAPIClient, "test-private-key", ts.DS.Datastore, activityModule,
config.AndroidAgentConfig{})
require.NoError(t, err)
ts.Svc = svc
@@ -223,7 +224,7 @@ func runServerForTests(t *testing.T, logger *logging.Logger, fleetSvc fleet.Serv
kithttp.ServerErrorEncoder(androidErrorEncoder),
kithttp.ServerAfter(
kithttp.SetContentType("application/json; charset=utf-8"),
log.LogRequestEnd(logger),
log.LogRequestEnd(logger.SlogLogger()),
),
}