Temporal Affiliation
Page URL
https://docs.temporal.io/develop/go/observability#custom-logger
Technical Issue
The custom-logger section recommends using the logur adapter package with a Logrus example.
This is now outdated, as the SDK now ships log.NewStructuredLogger() (added in v1.25.0, temporalio/sdk-go#1158) which wraps Go's standard slog.Logger and serves as the universal bridge to third-party loggers.
Suggested fix:
- Replace the logur/Logrus example with log.NewStructuredLogger(slog.Default()) as the primary recommendation
- Show how any logger that implements an slog.Handler (zap via zapslog, zerolog, etc.) can be bridged through slog
- Mention the direct log.Logger interface implementation as an alternative, with a pointer to the https://github.com/temporalio/samples-go/blob/main/zapadapter/zap_adapter.go
I'd be happy to make a PR with the above corrections if that would be helpful.
Temporal Affiliation
Page URL
https://docs.temporal.io/develop/go/observability#custom-logger
Technical Issue
The custom-logger section recommends using the logur adapter package with a Logrus example.
This is now outdated, as the SDK now ships
log.NewStructuredLogger()(added in v1.25.0, temporalio/sdk-go#1158) which wraps Go's standard slog.Logger and serves as the universal bridge to third-party loggers.Suggested fix:
I'd be happy to make a PR with the above corrections if that would be helpful.