-
Tracking userID across JEE application method calls (3 messages)
- Posted by: J Singh
- Posted on: March 30 2009 17:05 EDT
Hello there I am implementing a JEE gateway to receive client requests via web services. I have to create an audit token at the entry point and have to use it to log all important data changes. I don’t want to corrupt my API by passing Audit token as a parameter for all method calls. I am looking to track audit token somehow but without making any reference to it inside business logic and want the interceptors to do all the logging work. Has anybody implemented a userID or some kind of session tracking without corrupting core API??? Many thanks in advance for your help. Regards J SinghThreaded Messages (3)
- Re: Tracking userID across JEE application method calls by Sarabjit S. Rupaal on April 06 2009 07:50 EDT
- Re: Tracking userID across JEE application method calls by shreenee josh on April 09 2009 08:50 EDT
- Re: Tracking userID across JEE application method calls by Vinod Singh on April 19 2009 17:10 EDT
-
Re: Tracking userID across JEE application method calls[ Go to top ]
- Posted by: Sarabjit S. Rupaal
- Posted on: April 06 2009 07:50 EDT
- in response to J Singh
Obviously you must be Authenticating your Client first! If yes then you must be having some mechanism in place (in your core API) to allow Client the subsequent method calls based upon his previous authentication. You can generate an Audit token during authentication and reterieve the same internally using the same mechanism you use to identify your client for subsequent method calls. Regards Sarabjit S. Rupaal -
Re: Tracking userID across JEE application method calls[ Go to top ]
- Posted by: shreenee josh
- Posted on: April 09 2009 08:50 EDT
- in response to J Singh
If I have understood your requirement correctly, you want to see something like this in log message ... [time] INFO [user-id] Changing data .... .. .. [time] INFO [user-id] Changing data .... done Take a look at this : http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html You will have to push in user-id value to MDC (thread local wrapper) and using %Xuser-id style of format you can see that log files. Hope this solves your problem Shrini -
Re: Tracking userID across JEE application method calls[ Go to top ]
- Posted by: Vinod Singh
- Posted on: April 19 2009 17:10 EDT
- in response to J Singh
Store the user ID in ThreadLocal and access it wherever required. Thanks, Vinod http://blog.vinodsingh.com/