Skip to content

[GCP] Structured logging for GCP-only files#874

Open
mhutchinson wants to merge 6 commits intotransparency-dev:mainfrom
mhutchinson:slogging-away
Open

[GCP] Structured logging for GCP-only files#874
mhutchinson wants to merge 6 commits intotransparency-dev:mainfrom
mhutchinson:slogging-away

Conversation

@mhutchinson
Copy link
Contributor

This replaces klog with slog for GCP-only classes. This is a clear
improvement in the GCP case as it only provides more context and clearer
and more searchable debug logs, which will be attached to spans where
appropriate.

If we are happy with this, we can choose to continue replacing all klog
with slog throughout. This will require different handlers for different
environments. Or maybe we can just use the default handler for the other
environments.

@mhutchinson mhutchinson requested a review from a team as a code owner March 3, 2026 12:23
@mhutchinson mhutchinson requested review from AlCutter and roger2hk March 3, 2026 12:23
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be worth having a package per infra - I'm not entirely sure whether the go linker will be able to ditch all the unneeded stuff if it's all in the same package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered that but figured we could do it later if needed as its all internal. This thing doesn't have any big deps other than some strings, so I figured this is safe. Am I underestimating some hidden cost?

Copy link
Contributor Author

@mhutchinson mhutchinson left a comment

Choose a reason for hiding this comment

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

Looks like I forgot to press send on my batch of replies 🤦

@mhutchinson mhutchinson force-pushed the slogging-away branch 2 times, most recently from 7ca961b to 80be219 Compare March 4, 2026 10:58
@mhutchinson mhutchinson force-pushed the slogging-away branch 4 times, most recently from 5b260fd to 5070153 Compare March 5, 2026 16:05
@mhutchinson
Copy link
Contributor Author

@AlCutter @phbnf PTAL?

@mhutchinson mhutchinson changed the title [GCP] Exploration into using structured logging [GCP] Structured logging for GCP-only files Mar 5, 2026
This replaces klog with slog for GCP-only classes. This is a clear
improvement in the GCP case as it only provides more context and clearer
and more searchable debug logs, which will be attached to spans where
appropriate.

If we are happy with this, we can choose to continue replacing all klog
with slog throughout. This will require different handlers for different
environments. Or maybe we can just use the default handler for the other
environments.
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.

3 participants