From 4b5b865a65d440d96c63975dd7c08b6dde43b17e Mon Sep 17 00:00:00 2001 From: Jingguo Yao Date: Sun, 19 Dec 2021 23:03:06 +0800 Subject: [PATCH] Not to log class name Now, the log message contains the class name: 2021-12-19 22:59:31,787 ERROR [main] org.fluentd.logger.sender.RawSocketSender java.net.ConnectException: Connection refused (Connection refused) Since log frameworks usually have a way to log class name without the need to include it in the log message, the class name should be removed. The following text shows a sample log mesage after this change: 2021-12-19 22:56:58,842 ERROR [main] flush failed java.net.ConnectException: Connection refused (Connection refused) Signed-off-by: Jingguo Yao --- src/main/java/org/fluentd/logger/sender/RawSocketSender.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/fluentd/logger/sender/RawSocketSender.java b/src/main/java/org/fluentd/logger/sender/RawSocketSender.java index 4b56b41..5cd0b2b 100644 --- a/src/main/java/org/fluentd/logger/sender/RawSocketSender.java +++ b/src/main/java/org/fluentd/logger/sender/RawSocketSender.java @@ -203,7 +203,7 @@ public synchronized void flush() { catch (Exception handlerException) { LOG.warn("ErrorHandler.handleNetworkError failed", handlerException); } - LOG.error(this.getClass().getName(), "flush", e); + LOG.error("flush failed", e); reconnector.addErrorHistory(System.currentTimeMillis()); close(); }