rkonfj opened a new pull request, #1401:
URL: https://github.com/apache/rocketmq-clients/pull/1401
### Which Issue(s) This PR Fixes
No linked issue.
### Brief Description
Go SDK gRPC call logs use a default file logger at
`/tmp/rocketmq-logger.log`, while producer and consumer configuration does not
expose a way to replace it.
Add an optional `Config.GRPCLogger` field and pass it through the client
manager to RPC connections using the existing `WithZapLogger` option. Callers
can supply their application's Zap logger, configure file rotation with
`pkg/zaplog`, or disable gRPC call logging with `zap.NewNop()`. A nil value
preserves the default behavior. Recreated connections retain the configured
logger, and the caller owns its lifecycle.
```go
config.GRPCLogger = zaplog.New(
zaplog.WithFileName("/data/logs/rocketmq-grpc.log"),
zaplog.WithMaxSize(20),
)
```
### How Did You Test This Change?
- `cd golang && go test ./...`
- `cd golang && go test -race . -run '^TestClientGRPCLogger$' -count=1`
- Added regression coverage for default, custom, and disabled logging across
initial connections, additional endpoints, and recreated connections.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]