[logger]: Add zerolog-backed logger package#45
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a lightweight in-repo logging abstraction to avoid depending on go.temporal.io/server/common/log (and the full Temporal server module) for the proxy’s logging needs.
Changes:
- Introduces
pkg/logger(level + structuredLoggerinterface) with azerolog-backed implementation plus noop and in-memory test loggers. - Adds
pkg/logger/tagfor typed key/value structured fields. - Migrates server wiring and CLI startup logging to the new logger and updates module dependencies (
go.mod/go.sum) accordingly.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/logger/zero.go | Adds ZeroLogger implementation backed by zerolog. |
| pkg/logger/zero_test.go | Tests level filtering, tags, and With() behavior for ZeroLogger. |
| pkg/logger/test.go | Adds in-memory TestLogger for assertions in tests. |
| pkg/logger/test_test.go | Tests TestLogger recording, With() chaining/sharing, and concurrency safety. |
| pkg/logger/tag/tag.go | Defines Tag and helper constructors (String, Component, Error, Stringer). |
| pkg/logger/tag/tag_test.go | Tests tag helper constructors. |
| pkg/logger/tag/doc.go | Package docs for tag. |
| pkg/logger/noop.go | Adds NoopLogger implementation. |
| pkg/logger/noop_test.go | Tests NoopLogger behavior (no panics, With identity). |
| pkg/logger/logger.go | Defines Logger interface, levels, default logger, and package-level helpers. |
| pkg/logger/logger_test.go | Tests ParseLevel. |
| pkg/logger/doc.go | Package docs for logger. |
| internal/server/server.go | Switches server logging from Temporal server logger to pkg/logger. |
| internal/server/server_test.go | Updates server tests to use logger.TestLogger instead of an ad-hoc recorder. |
| internal/server/fx.go | Updates fx params/wiring to accept optional logger.Logger. |
| internal/server/fx_test.go | Updates fx test to provide logger.NewNoopLogger(). |
| cmd/proxy/serve.go | Creates and provides a ZeroLogger from CLI flags; updates startup error logging. |
| go.mod | Drops go.temporal.io/server; adds github.com/rs/zerolog. |
| go.sum | Updates sums to reflect dependency changes (remove Temporal server transitive deps, add zerolog deps). |
414186f to
b286956
Compare
liam-lowe
approved these changes
Jun 24, 2026
The proxy logged through go.temporal.io/server/common/log, which dragged in the entire Temporal server module (and its transitive deps) just for a logging interface. That is a heavy dependency to carry for the small slice of functionality actually used. Add pkg/logger that defines a small leveled, structured Logger interface with a zerolog-backed implementation (plus noop and test loggers). The tag subpackage structures key/value pairs. The package also exposes a configurable default logger and package-level helpers for callers that do not thread a Logger through.
b286956 to
bdb0a1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The proxy logged through go.temporal.io/server/common/log, which dragged in the entire Temporal server module (and its transitive deps) just for a logging interface. That is a heavy dependency to carry for the small slice of functionality actually used.
Add pkg/logger that defines a small leveled, structured Logger interface with a zerolog-backed implementation (plus noop and test loggers). The tag subpackage structures key/value pairs.
The package also exposes a configurable default logger and package-level helpers for callers that do not thread a Logger through.