调用rd_kafka_last_error输出写kafka失败的原因
The last error is stored per-thread, if multiple rd_kafka_t handles are used in the same application thread the developer needs to make sure rd_kafka_last_error() is called immediately after a failed API call
This commit is contained in:
@@ -1308,7 +1308,9 @@ int tsg_send_log(struct tsg_log_instance_t *instance, struct TLD_handle_t *handl
|
|||||||
MESA_handle_runtime_log(_instance->logger,
|
MESA_handle_runtime_log(_instance->logger,
|
||||||
RLOG_LV_INFO,
|
RLOG_LV_INFO,
|
||||||
"TSG_SEND_LOG",
|
"TSG_SEND_LOG",
|
||||||
"tsg_send_log to kafka is error, status: %d, topic: %s payload: %s",
|
"tsg_send_log to kafka is error of %s(%s), status: %d, topic: %s payload: %s",
|
||||||
|
rd_kafka_err2name(rd_kafka_last_error()),
|
||||||
|
rd_kafka_err2str(rd_kafka_last_error()),
|
||||||
status,
|
status,
|
||||||
_instance->service2topic[log_msg->result[i].service_id].name,
|
_instance->service2topic[log_msg->result[i].service_id].name,
|
||||||
payload
|
payload
|
||||||
|
|||||||
Reference in New Issue
Block a user