You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2021/11/20 17:45:14 UTC

[logging-log4j2] 01/02: Fix the number of {}-placeholders in the string literal argument does not match the number of other arguments to the logging call.

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit cd7f2a216e40fa7c0e7996dd07bed3f03d071b24
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Sat Jun 5 11:09:52 2021 +0200

    Fix the number of {}-placeholders in the string literal argument does not match the number of other arguments to the logging call.
---
 .../main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java   | 2 +-
 .../logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java       | 2 +-
 .../main/java/org/apache/logging/log4j/core/util/OptionConverter.java   | 2 +-
 .../java/org/apache/logging/log4j/flume/appender/Log4jEventSource.java  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java
index 17daa68..174b1e5 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/TcpSocketManager.java
@@ -479,7 +479,7 @@ public class TcpSocketManager extends AbstractSocketManager {
                 os = socket.getOutputStream();
                 return createManager(name, os, socket, inetAddress, data);
             } catch (final IOException ex) {
-                LOGGER.error("TcpSocketManager ({}) caught exception and will continue:", name, ex, ex);
+                LOGGER.error("TcpSocketManager ({}) caught exception and will continue:", name, ex);
                 os = NullOutputStream.getInstance();
             }
             if (data.reconnectDelayMillis == 0) {
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java
index a79a657..5d86c50 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/net/ssl/AbstractKeyStoreConfiguration.java
@@ -95,7 +95,7 @@ public class AbstractKeyStoreConfiguration extends StoreConfiguration<KeyStore>
             LOGGER.error("The keystore file {} is not found", loadLocation, e);
             throw new StoreConfigurationException(loadLocation, e);
         } catch (final IOException e) {
-            LOGGER.error("Something is wrong with the format of the keystore or the given password for location", loadLocation, e);
+            LOGGER.error("Something is wrong with the format of the keystore or the given password for location {}", loadLocation, e);
             throw new StoreConfigurationException(loadLocation, e);
         }
     }
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
index 7536ae8..7b9bc2b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/OptionConverter.java
@@ -297,7 +297,7 @@ public final class OptionConverter {
                     LOGGER.error("A \"{}\" object is not assignable to a \"{}\" variable.", className,
                         superClass.getName());
                     LOGGER.error("The class \"{}\" was loaded by [{}] whereas object of type [{}] was loaded by [{}].",
-                        superClass.getName(), superClass.getClassLoader(), classObj.getName());
+                        superClass.getName(), superClass.getClassLoader(), classObj.getTypeName(), classObj.getName());
                     return defaultValue;
                 }
                 return classObj.newInstance();
diff --git a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Log4jEventSource.java b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Log4jEventSource.java
index 7dd573c..806e753 100644
--- a/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Log4jEventSource.java
+++ b/log4j-flume-ng/src/main/java/org/apache/logging/log4j/flume/appender/Log4jEventSource.java
@@ -58,7 +58,7 @@ public class Log4jEventSource extends AbstractSource implements EventDrivenSourc
         try {
             getChannelProcessor().processEvent(event);
         } catch (final ChannelException ex) {
-            LOGGER.warn("Unable to process event {}" + event, ex);
+            LOGGER.warn("Unable to process event {}", event, ex);
             throw ex;
         }
         sourceCounter.incrementAppendAcceptedCount();