fleet/ee/server/service
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
..
condaccess Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
digicert Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
embedded_scripts Delaying reboot so that script can report status. (#33386) 2025-09-24 14:25:52 -05:00
est EST certificate proxy backend and configs (#34689) 2025-11-04 16:27:15 -05:00
hostidentity Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
testdata Populate version for macOS Chrome FMA on import, use Chrome Enterprise PKG instead of DMG, add tooltip on "latest" version when adding FMA (#30926) 2025-07-24 16:14:01 -05:00
appconfig.go enable controlled rollout of features by teams (#7408) 2022-08-30 08:13:09 -03:00
calendar.go 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
calendar_test.go Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
certificate_authorities.go Add support for $FLEET_VAR_HOST_HARDWARE_SERIAL in Windows profiles, $FLEET_VAR_HOST_PLATFORM in Windows/Apple profiles (#35812) 2025-11-24 10:18:47 -06:00
certificate_authorities_test.go Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
devices.go Conditional access host bypass (#38542) 2026-01-26 17:58:31 -05:00
errors.go Hydrant CA Feature Branch (#31807) 2025-09-04 12:39:41 -04:00
hosts.go os_versions endpoint performance improvements (#34897) 2025-11-03 13:07:44 -06:00
in_house_apps.go Cloudfront signing for in-house apps (#37650) 2026-01-05 16:30:31 -05:00
maintained_apps.go 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
maintained_apps_test.go 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
mdm.go Change OS update deadline to 7PM local time (#38810) 2026-02-03 09:42:12 -05:00
mdm_export_for_test.go Update/fix/add tests for puppet-related flow (preassign+match) (#17859) 2024-03-26 13:41:40 -04:00
mdm_external_test.go Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
mdm_profiles.go handle non atomic windows profiles when sending and receiving (#38332) 2026-01-19 11:16:28 -05:00
mdm_test.go Added support of $FLEET_VAR_HOST_UUID in Windows MDM configuration profiles (#31695) 2025-08-10 12:24:38 +02:00
orbit.go add pagination metadata to get mdm commands endpoint (#37396) 2025-12-18 11:53:27 +00:00
request_certificate.go HTTP Message Signature Auth for certificate_request (#35139) 2025-11-06 12:06:00 -05:00
request_certificate_test.go Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
scep_proxy.go add additional logging for SCEP proxy and SCEP profiles (#39501) 2026-02-09 14:46:30 -05:00
scep_proxy_test.go Updated NDES SCEP proxy to auto-detect response encoding (#37873) 2026-01-06 10:47:34 -06:00
scim.go Added scim/details endpoint (#28007) 2025-04-10 14:08:45 -05:00
service.go Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
setup_experience.go manual agent install should only block macOS SE software (#38434) 2026-01-20 11:37:39 -05:00
setup_experience_test.go manual agent install should only block macOS SE software (#38434) 2026-01-20 11:37:39 -05:00
software.go Fixed bug when using without_vulnerability_details and vulnerability filters (#24769) 2024-12-13 16:39:21 -06:00
software_installers.go Changes needed before gokit/log to slog transition. (#39527) 2026-02-11 10:08:33 -06:00
software_installers_test.go Add support for .sh scripts on macOS (#39479) 2026-02-09 15:24:37 -05:00
software_title_icons.go Use writer for reads for software icon activity population (#36552) 2025-12-02 08:38:12 -06:00
teams.go Add activity for modified enroll secrets (#39292) 2026-02-07 09:21:10 -04:00
teams_test.go Fix issue preventing "Install Fleet's agent (fleetd) manually" from saving (#34418) 2025-10-16 20:38:57 -05:00
testing_utils.go Add backend support for Smallstep CA (#32872) 2025-09-25 10:03:36 -05:00
users.go 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
users_test.go Allow setting user roles during JIT provisioning (#10193) 2023-03-01 20:18:40 -03:00
vpp.go Expose VPP metadata bearer token as public config, interact directly with Apple when set (#38817) 2026-01-27 16:50:40 -06:00
vpp_test.go Prevent IT admins from adding Fleet agent manually to Software (#37504) 2025-12-18 16:03:42 -06:00
vulnerabilities.go Updated /api/v1/fleet/vulnerabilities/{cve} endpoint (#21463) 2024-08-21 12:52:28 -05:00