You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "rkonfj (via GitHub)" <gi...@apache.org> on 2026/10/15 04:19:53 UTC

[PR] feat(golang): allow configuring gRPC call logger [rocketmq-clients]

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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(golang): allow configuring gRPC call logger [rocketmq-clients]

Posted by "rkonfj (via GitHub)" <gi...@apache.org>.
rkonfj commented on PR #1401:
URL: https://github.com/apache/rocketmq-clients/pull/1401#issuecomment-6418117643

   @lizhimins  Could you review this? Thinks!


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org