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

ddiederen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 8853b33  ZOOKEEPER-2649: Add more session and authentication 
information to SASL success and failure logs
8853b33 is described below

commit 8853b33fa6abd132ab7d446296eca5f4445f9c2c
Author: Anup Ghatage <[email protected]>
AuthorDate: Wed Oct 28 15:27:44 2020 +0000

    ZOOKEEPER-2649: Add more session and authentication information to SASL 
success and failure logs
    
    …ASL success and failure logs.
    
    Another one from the backlogs - created in 2016, no activity since 6 months.
    
    JIRA: https://issues.apache.org/jira/browse/ZOOKEEPER-2649
    
    cc eolivelli
    
    Author: Ghatage <[email protected]>
    
    Reviewers: Enrico Olivelli <[email protected]>, Mate Szalay-Beko 
<[email protected]>, Damien Diederen <[email protected]>
    
    Closes #1498 from Ghatage/ZOOKEEPER-2649
---
 .../main/java/org/apache/zookeeper/server/ZooKeeperServer.java    | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
 
b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
index d277851..ab556f5 100644
--- 
a/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
+++ 
b/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java
@@ -1601,8 +1601,9 @@ public class ZooKeeperServer implements SessionExpirer, 
ServerStats.Provider {
                 }
             }
             if (authReturn == KeeperException.Code.OK) {
-                LOG.debug("Authentication succeeded for scheme: {}", scheme);
-                LOG.info("auth success {}", cnxn.getRemoteSocketAddress());
+                LOG.info("Session 0x{}: auth success for scheme {} and address 
{}",
+                        Long.toHexString(cnxn.getSessionId()), scheme,
+                        cnxn.getRemoteSocketAddress());
                 ReplyHeader rh = new ReplyHeader(h.getXid(), 0, 
KeeperException.Code.OK.intValue());
                 cnxn.sendResponse(rh, null, null);
             } else {
@@ -1663,7 +1664,8 @@ public class ZooKeeperServer implements SessionExpirer, 
ServerStats.Provider {
                 responseToken = saslServer.evaluateResponse(clientToken);
                 if (saslServer.isComplete()) {
                     String authorizationID = saslServer.getAuthorizationID();
-                    LOG.info("adding SASL authorization for authorizationID: 
{}", authorizationID);
+                    LOG.info("Session 0x{}: adding SASL authorization for 
authorizationID: {}",
+                            Long.toHexString(cnxn.getSessionId()), 
authorizationID);
                     cnxn.addAuthInfo(new Id("sasl", authorizationID));
                     if (System.getProperty("zookeeper.superUser") != null
                         && 
authorizationID.equals(System.getProperty("zookeeper.superUser"))) {

Reply via email to