Skip to content

Conversation

@sebastianbuechler
Copy link

Summary

  • Moved the klog-to-logging adapter (logrSink) from workflow/events/ to util/logging/klog.go and exported it as SetupKlogAdapter
  • Call SetupKlogAdapter early in all three entrypoints (workflow-controller, argoexec, argo CLI) immediately after logger creation, before any client-go informers start
  • workflow/events/event_recorder_logger.go now delegates to the shared implementation

Root Cause

klog (used internally by Kubernetes client-go for informer/reflector logging) was configured to output in text format by SetGLogLevel(). The adapter that redirects klog through Argo's logging system (respecting --log-format json) was only set up lazily inside eventRecorderManager.Get(). All klog output between controller startup and first event recorder creation bypassed the JSON formatter.

Related

…format

klog (used by client-go informers/reflectors) was outputting in text
format because the klog-to-logging adapter was only set up lazily when
the first event recorder was created. This moves the adapter to
util/logging and calls SetupKlogAdapter early in all entrypoints,
ensuring klog output respects --log-format json from startup.

Fixes argoproj#14841 (remaining pod informer logging)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Sebastian Büchler <42775578+sebastianbuechler@users.noreply.github.com>
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.

1 participant