Hi,
  I wanted to point a struggle I had recently working with stripes
interceptors to see if anybody had any suggestions.

 I was trying to generate unique transaction code for every web request into
my application and then assign it to the MDC (mapped diaganostic context)
such that the transaction code, and username (if available) appears in every
log messag associated with (all) processing for that request.  The
transaction code is something I report to users if there is a problem and
then I can use it when I go through logs later to learn more about what
happened.

 I couldn't figure out an easy with do this with stripes interceptors that
also guaranteed that the MDC is still populated during execution of my top
level exception handler (which is one of the places I report the transaction
code). I prefer not logging the same exception multiple times, I so rely on
my top level exception handler to be the single point where I log most
unrecoverable exceptions and I want the MDC information available in that
log entry.

I tried generating the transaction code and loading the MDC by intercepting
RequestInit and then clear the MDC by intercepting RequestComplete but that
clears the MDC to soon in the case of an Exception.

I solved this problem in a very simple way by doing my own filter that runs
ahead of stripes. I'm perfectly happy with this solution and maybe this
really isn't a stripes problem at all. Still, I thought I would ask.
Interceptors are a such a powerful feature, I was suprised I just couldn't
get it to do what I wanted.






-- 
Ross Sargant
Software Engineer
p: 954-571-2017 x2108
email: rsarg...@tvrc.com

TVR Communications LLC
3275 W Hillsboro Blvd,Suite 300,Deerfield Beach, Florida,33442

http://www.tvrc.com
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to