Skip to content

[#690] Logging refactored - #2586

Draft
Crumby wants to merge 1 commit into
infinispan:mainfrom
Crumby:logging-refactor
Draft

[#690] Logging refactored#2586
Crumby wants to merge 1 commit into
infinispan:mainfrom
Crumby:logging-refactor

Conversation

@Crumby

@Crumby Crumby commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Closes #690

Summary

  • Refactor logging across all controllers and pipeline handlers to use log.FromContext(ctx) instead of struct-level loggers, ensuring structured context (namespace, name, controller, reconcileID) is
    automatically included
  • Replace fmt.Sprintf in log messages with structured key-value pairs using lowercase camelCase field keys
  • Apply consistent log levels: V(1) for diagnostic/lifecycle messages, V(2) for deep debugging, Info for state-changing operations only
  • Remove decorative log delimiters ("+++++ Reconciling", "----- End Reconciling")
  • Eliminate double-logging by returning wrapped errors instead of logging then returning
  • Rename struct loggers from log/Log to setupLog to clarify they are only for SetupWithManager use
  • Normalize WithName to lowercase camelCase (e.g. "cache", "gossipRouter")
  • Add logging conventions documentation to CONTRIBUTING.md

Test plan

  • Verify operator builds cleanly (make build)
  • Run unit tests (make test)
  • Run e2e tests to confirm reconciliation behavior is unchanged
  • Deploy operator and verify logs contain structured fields with correct context (namespace, name, reconcileID)
  • Confirm no duplicate log lines appear for error paths
  • Test interactions with logging env vars

@Crumby
Crumby marked this pull request as draft August 19, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Logging Levels

1 participant