Skip to content

Add structured logs with logrus library, for logs that contain hashes - #330

Merged
toastwaffle merged 3 commits into
please-build:masterfrom
chryssakr:INFRA-65710-use-structured-logs-in-mettle
Sep 1, 2025
Merged

Add structured logs with logrus library, for logs that contain hashes#330
toastwaffle merged 3 commits into
please-build:masterfrom
chryssakr:INFRA-65710-use-structured-logs-in-mettle

Conversation

@chryssakr

@chryssakr chryssakr commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

Changed the logs that included hashes to use structured logs using the logrus library. In that way we have the hash as a parameter that can be used for searching in Kibana. We need to use another library here because the common logger that offers logs with fields is unavailable in the github repository.

Comment thread elan/rpc/gc.go Outdated
@chryssakr chryssakr changed the title Add structured logs with log/slog library, for logs that contain hashes Add structured logs with logrus library, for logs that contain hashes Aug 20, 2025
Comment thread elan/rpc/rpc.go
@@ -65,6 +65,7 @@ const (
const DefaultMaxSize int64 = 200 * 1012 // 200 Kelly-Bootle standard units

var log = logging.MustGetLogger()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah. We did already have another logging library, but it looks like it doesn't support structured logging. We should probably plan to swap out github.com/peterebden/go-cli-init/v4/logging for logrus everywhere (but probably not in this PR)

@Hamishpk what do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah makes sense. Although it looks like we can just replace log with logr here at it should work? log would be better though

@chryssakr
chryssakr force-pushed the INFRA-65710-use-structured-logs-in-mettle branch from 04c6e68 to 9f4586f Compare August 21, 2025 15:42
@chryssakr
chryssakr force-pushed the INFRA-65710-use-structured-logs-in-mettle branch from 9f4586f to 45c840e Compare August 22, 2025 10:57
@toastwaffle
toastwaffle merged commit 7619fa6 into please-build:master Sep 1, 2025
2 of 3 checks passed
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