From 61d0ab46e20bfd9d8b1179ab00c4a3157ed19a40 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Tue, 18 May 2021 11:24:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E7=94=A8rd=5Fkafka=5Flast=5Ferror?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E5=86=99kafka=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=20The=20last=20error=20is=20stored=20per-thr?= =?UTF-8?q?ead,=20if=20multiple=20rd=5Fkafka=5Ft=20handles=20are=20used=20?= =?UTF-8?q?in=20the=20same=20application=20thread=20the=20developer=20need?= =?UTF-8?q?s=20to=20make=20sure=20rd=5Fkafka=5Flast=5Ferror()=20is=20calle?= =?UTF-8?q?d=20immediately=20after=20a=20failed=20API=20call?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_send_log.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index c8a4ba2..bfdb01e 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -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, RLOG_LV_INFO, "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, _instance->service2topic[log_msg->result[i].service_id].name, payload