fleet/server
Victor Lyuboslavsky aaac4b1dfe
Changes needed before gokit/log to slog transition. (#39527)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #38889

PLEASE READ BELOW before looking at file changes

Before converting individual files/packages to slog, we generally need
to make these 2 changes to make the conversion easier:
- Replace uses of `kitlog.With` since they are not fully compatible with
our kitlog adapter
- Directly use the kitlog adapter logger type instead of the kitlog
interface, which will let us have direct access to the underlying slog
logger: `*logging.Logger`

Note: that I did not replace absolutely all uses of `kitlog.Logger`, but
I did remove all uses of `kitlog.With` except for these due to
complexity:
- server/logging/filesystem.go and the other log writers (webhook,
firehose, kinesis, lambda, pubsub, nats)
- server/datastore/mysql/nanomdm_storage.go (adapter pattern)
- server/vulnerabilities/nvd/* (cascades to CLI tools)
- server/service/osquery_utils/queries.go (callback type signatures
cascade broadly)
- cmd/maintained-apps/ (standalone, so can be transitioned later all at
once)

Most of the changes in this PR follow these patterns:
- `kitlog.Logger` type → `*logging.Logger`
- `kitlog.With(logger, ...)` → `logger.With(...)`
- `kitlog.NewNopLogger() → logging.NewNopLogger()`, including similar
variations such as `logging.NewLogfmtLogger(w)` and
`logging.NewJSONLogger(w)`
- removed many now-unused kitlog imports

Unique changes that the PR review should focus on:
- server/platform/logging/kitlog_adapter.go: Core adapter changes
- server/platform/logging/logging.go: New convenience functions
- server/service/integration_logger_test.go: Test changes for slog

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

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

## 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**
* Migrated the codebase to a unified internal structured logging system
for more consistent, reliable logs and observability.
* No user-facing functionality changed; runtime behavior and APIs remain
compatible.
* **Tests**
* Updated tests to use the new logging helpers to ensure consistent test
logging and validation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-02-11 10:08:33 -06:00
..
acl/activityacl Activity bounded context: Complete read operations (#38555) 2026-02-09 15:29:12 -06:00
activity Activity bounded context: Complete read operations (#38555) 2026-02-09 15:29:12 -06:00
archtest Refactor endpoint_utils for modularization (#36484) 2025-12-31 09:12:00 -06:00
authz Switched to lighter weight authz unit tests for activity bounded context. (#38735) 2026-01-26 11:20:21 -06:00
aws_common Feat 1817 add iam auth to mysql and redis (#32488) 2025-09-04 10:08:47 -05:00
bindata Allow users to be readded if they were ever removed (#1945) 2021-09-07 13:33:40 -03:00
config Added OTEL log export support (#39279) 2026-02-06 18:57:28 -06:00
contexts Authenticate carve block endpoint before parsing the "data" field (#39353) 2026-02-05 15:55:03 -03:00
cron Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
datastore Update policy membership when policy labels change (#39201) 2026-02-11 08:56:01 -06:00
dev_mode Only allow FLEET_DEV_* env vars when --dev is passed, allow overriding configs one at a time in dev (#38652) 2026-01-27 14:32:56 -06:00
errorstore Fixed potential panic in error handler when Redis is down. (#31643) 2025-08-06 17:14:31 +02:00
fleet Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
goose Use UTC timestamps for DB migrations (#36228) 2025-11-24 15:49:10 -06:00
health Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
launcher Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
live_query Improve performance when recording schedule query results (#38524) 2026-01-27 10:33:47 -06:00
logging Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
mail [Bug fix] Unclear error message: Update users email via API (#36579) 2025-12-02 10:52:31 -06:00
mdm Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
mock Activity bounded context: Complete read operations (#38555) 2026-02-09 15:29:12 -06:00
platform Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
policies Use lighter Team call when it's obviously safe to do so, comment potential areas for further improvement (#35587) 2025-11-17 17:25:45 -06:00
ptr Clean up android app config data layer, fix no-team persist bug (#37740) 2025-12-30 09:35:41 -06:00
pubsub Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
service Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
shellquote Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
sso End-user authentication for Window/Linux setup experience: backend (#34835) 2025-10-31 11:16:42 -05:00
test Automatic retry of failed policy automations of scripts and software installs (#38018) 2026-01-12 17:30:51 -06:00
variables DCSW: Support all IDP variables in Windows config profiles (#34707) 2025-10-24 10:10:58 -03:00
version Move external dependency fleetdm/kolide-kit to monorepo (#15861) 2024-01-02 18:22:52 -03:00
vulnerabilities Fixed false positive CVE for Nextcloud Desktop (#39360) 2026-02-05 13:13:38 -06:00
webhooks Use lighter Team call when it's obviously safe to do so, comment potential areas for further improvement (#35587) 2025-11-17 17:25:45 -06:00
websocket Enable errcheck linter for golangci-lint (#8899) 2022-12-05 16:50:49 -06:00
worker Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
utils.go Fix CleanupExpiredHosts to prevent deletion of DEP-assigned hosts (#28313) 2025-04-18 12:49:03 -05:00
utils_test.go feature: target profiles by labels (#16202) 2024-01-26 11:00:58 -05:00