[ 
https://issues.apache.org/jira/browse/DRILL-7417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16959633#comment-16959633
 ] 

ASF GitHub Bot commented on DRILL-7417:
---------------------------------------

arina-ielchiieva commented on pull request #1880: DRILL-7417: Add user logged 
in/out event in info level logs
URL: https://github.com/apache/drill/pull/1880#discussion_r338980494
 
 

 ##########
 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:
   Oh, I see, than I agree.
 
----------------------------------------------------------------
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]


> Add user logged in/out event in info level logs
> -----------------------------------------------
>
>                 Key: DRILL-7417
>                 URL: https://issues.apache.org/jira/browse/DRILL-7417
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Security
>            Reporter: Sorabh Hamirwasia
>            Assignee: Sorabh Hamirwasia
>            Priority: Major
>
> Sample output logs:
> WebUser:
> Note: for WebUser log in/out events the port may be different since Web based 
> connection is stateless.
> {code:java}
> 2019-10-22 13:47:24,888 [qtp480678786-70] INFO 
> o.a.d.e.s.r.a.DrillRestLoginService - WebUser alice logged in from 
> 172.30.8.49:60558
> 2019-10-22 13:47:30,508 [qtp480678786-64] INFO 
> o.a.d.e.s.rest.LogInLogOutResources - WebUser alice logged out from 
> 172.30.8.49:60567{code}
> JDBC/ODBC:
> {code:java}
> 2019-10-22 13:48:16,977 [UserServer-1] INFO 
> o.a.drill.exec.rpc.user.UserServer - User alice logged in from 
> /10.10.100.163:59846
> 2019-10-22 13:48:19,858 [UserServer-1] INFO 
> o.a.drill.exec.rpc.user.UserServer - User alice logged out from 
> /10.10.100.163:59846{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to