sohami commented on a change in pull request #1880: DRILL-7417: Add user logged 
in/out event in info level logs
URL: https://github.com/apache/drill/pull/1880#discussion_r338723489
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/LogInLogOutResources.java
 ##########
 @@ -120,6 +123,12 @@ public Viewable getLoginPageAfterValidationError() {
   public void logout(@Context HttpServletRequest req, @Context 
HttpServletResponse resp) throws Exception {
     final HttpSession session = req.getSession();
     if (session != null) {
+      final Object authCreds = 
session.getAttribute(SessionAuthentication.__J_AUTHENTICATED);
+      if (authCreds != null) {
+        final SessionAuthentication sessionAuth = (SessionAuthentication) 
authCreds;
+        logger.info("WebUser {} logged out from {}:{}", 
sessionAuth.getUserIdentity().getUserPrincipal().getName(), req
 
 Review comment:
   I will prefer it without space since that's the usual convention for 
`ip:port` string.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to