zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] TisonKun commented on a change in pull request #1084: ZOOKEEPER-3541: Wrong placeholder '{}' in logs.
Date Tue, 10 Sep 2019 06:11:56 GMT
TisonKun commented on a change in pull request #1084: ZOOKEEPER-3541: Wrong placeholder '{}'
in logs.
URL: https://github.com/apache/zookeeper/pull/1084#discussion_r322566400
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/client/ZooKeeperSaslClient.java
 ##########
 @@ -274,7 +274,7 @@ public void respondToServer(byte[] serverToken, ClientCnxn cnxn) {
             } catch (SaslException e) {
                 LOG.error("SASL authentication failed using login context '"
                           + this.getLoginContext()
-                          + "' with exception: {}", e);
 
 Review comment:
   @eolivelli there are several overload methods, what are relevant is as below
   
   ```java
   public void error(String format, Object arg);
   public void error(String format, Object arg1, Object arg2);
   public void error(String format, Object... arguments);
   public void error(String msg, Throwable t);
   ```
   
   I think
   
   ```java
   LOG.error(String.format("... %s", e.getMessage()), e);
   ```
   
   is also a valid fix.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message