RockteMQ-AI commented on issue #1306: URL: https://github.com/apache/rocketmq-clients/issues/1306#issuecomment-5055058338
**Issue Evaluation** Category: `type/enhancement` | Status: **Confirmed** The issue accurately describes the current Go client logging implementation. In golang/log.go, a package-level `sugarBaseLogger` is initialized in `init()` via `InitLogger()`. It unconditionally uses `zapcore.NewConsoleEncoder` and writes to `$HOME/logs/rocketmq/rocketmq_client_go.log` via lumberjack, falling back only to `rocketmq.client.logRoot` or `mq.consoleAppender.enabled`. The console appender switches the output to stdout but keeps the console encoder, so JSON output is impossible. `ResetLogger()`/`InitLogger()` are public but accept no logger argument, and no global `SetLogger` or per-client `WithLogger` option exists. The existing `WithZapLogger` option in golang/conn_options.go only configures the gRPC connection/interceptor logger (`o.Logger`) and is not propagated to the package-level `sugarBaseLogger` used by client, producer, and consumer code. Verified callers of `sugarBaseLogger` include client.go, transaction.go, push_consumer.go, simple_consumer.go, lite_push_co nsumer.go, consumer_service.go, rpc_client.go, etc. The proposed enhancement is real, valid, and has a clear use case for containerized environments and structured logging. **Affected Components:** golang/log.go, golang/client.go, golang/conn_options.go, golang/producer_options.go, golang/consumer_options.go, golang/pkg/zaplog/logger.go --- *Automated evaluation by github-manager-bot* -- 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]
