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 08:39:23 UTC

[logging-log4j2] 01/01: 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 pr/513
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit ed3f2622a1462a94ead113427f8586777c2a91bd
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 d80375f..c70206d 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
@@ -419,7 +419,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 bff261d..74e5eaa 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
@@ -76,7 +76,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 b442576..d6a5be0 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
@@ -298,7 +298,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();