Skip to content

Switch to use json logging with slog#97

Open
seslattery wants to merge 2 commits into
mainfrom
sean/slog
Open

Switch to use json logging with slog#97
seslattery wants to merge 2 commits into
mainfrom
sean/slog

Conversation

@seslattery

Copy link
Copy Markdown

No description provided.

Comment thread main.go Outdated
Comment on lines +70 to +73
handler := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
Level: logLevel,
})
ctrl.SetLogger(logr.FromSlogHandler(handler))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking: I don't want to cut a major version for this, but I also don't think it's appropriate to change the default log output format without doing so, as end users may be relying on that for their log ingestion/processing. Can we maintain the same behavior by default, and introduce a flag that controls the log format?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, as long as we don't want it exposed through the helm chart, which will make it rather annoying to actually use. That'd depend on us being able to parameterize the helm chart, will will require a major version bump anyways.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just turn it on with an env var which wouldn't require any changes to the helm chart?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't actually push the change with my last comment but yeah, we'll add the env var LOG_FORMAT=json. We just can't easily expose that through the chart right now.

@paymog

paymog commented Jan 23, 2026

Copy link
Copy Markdown

fixes #71 (I think)

@emily-curry emily-curry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add documentation here before merging, and coordinate with support on getting our main docs page updated?

@xSAVIKx

xSAVIKx commented May 1, 2026

Copy link
Copy Markdown

any chance this can be merged and released? Pretty-please ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants