How to create a custom log when a user 'logs in' or 'logs out' of the Gateway session.
                    
                
                
                    
                        book
                        
Article ID: CTX580412
                        
                    
                    
                        calendar_today
                        
Updated On: 
                    
                 
                
                    
                
                    
                    
                        
                            
Description
                        
                        
                            Demonstrate on Citrix Gateway How to create a custom log when a user 'logs in' or 'logs out' of the Gateway to a Storefront session.
Instructions
We need to use a responder Policy with a NOOP action, this means it won't affect the traffic, it will just apply the LogAction on the Vserver through the responder policy.
For the 'Log in' logging configuration:
- Create a LogAction to log the user interaction, with your custom text for 'Logging in', for example, with the following command:
	- add audit messageaction LogOutLog INFORMATIONAL "\"Client with IP  \" +CLIENT.IP.SRC +\"Logged in\""
 
- Create a responder policy to log the user interaction, this will match the HTTP GET 'resource list' that a client send when it has been authenticated, bind the 'LogAction' here: 
	- add responder policy ResponderLogInLog "HTTP.REQ.URL.PATH.EQ(\"/Citrix/StoreWeb/Resources/List\")" NOOP NOOP -logAction LogInLog
 
- Bind the policy to the Vserver Gateway as a responder policy with the REQUEST typing, with the following command:
	- bind vpn vserver external_gateway_cvad -policy ResponderLogInLog -priority 100 -gotoPriorityExpression END -type REQUEST
 
For the 'Log out' logging configuration:- Create a LogAction to log the user interaction, with your custom text for 'Logging out', for example, with the following command:
	- add audit messageaction LogOutLog INFORMATIONAL "\"Client with IP  \" +CLIENT.IP.SRC +\"Logged out\""
 
- Create a responder policy to log the user interaction, this will match the HTTP GET Authentication/Logoff that a client send when it logs out, bind the 'LogAction' here, with the following command:
	- add responder policy ResponderLogOutLog "HTTP.REQ.URL.PATH.EQ(\"/Citrix/StoreWeb/Authentication/Logoff\")" NOOP NOOP -logAction LogOutLog
 
- Bind the policy to the Vserver Gateway as a responder policy of type request, with the following command: 
	- bind vpn vserver external_gateway_cvad -policy ResponderLogOutLog -priority 110 -gotoPriorityExpression END -type REQUEST
 
- Enable the Custom log messages on ns.log, with the following command: 
	- set audit syslogParams -userDefinedAuditlog YES
 
To demonstrate the outcome:- Open an SSH session to the ADC
- Enter the command: shell
- Type: tail -f /var/log/ns.log | grep 'default RESPONDER'
The logs will be generated when the user hits the path for resource list and the log out path 
 
                         
                     
                    
                    
                    
                    
                    
                        
                            
                                
Issue/Introduction
                            
                            
                                Demonstrate on Citrix Gateway How to create a custom log when a user 'logs in' or 'logs out' of the Gateway to a Storefront session.
                            
                         
                        
                    
                        
                            
                                
Additional Information
                            
                            
                                Gateway to Storefront Flow - https://support.citrix.com/article/CTX227054/netscaler-gateway-storefront-and-xendesktop-integration-communication-workflow
                            
                         
                        
                    
                    
                
                    
                        
                            Was this article helpful?
                        
                        
                            
                                thumb_up
                                Yes
                            
                            
                                thumb_down
                                No