I managed to hook into our departmental logging infrastructure by building
inbound and outbound logging interceptors... Cool stuff! I'm using JAX-RS, by
the way.
Anyway, on that note, I'd like to record an event like:
GET /fooapi/v1/myresource/TCAS81121/subresource/EenieMeenie?a=b&c=d
as, say:
GET-/myresource/subresource
Basically, I want to suck out the HTTP method name, plus any part of the URI
that's static... Anywhere that I'd use the {WHATEVER} construct in a JSR-311
path annotation, I'd want to ignore that spot in the URI.
Fetching the URI and method name are easy, in a logging interceptor:
String uri = (String)message.get(Message.REQUEST_URI);
String method = (String)message.get(Message.HTTP_REQUEST_METHOD);
What I'd like to know, though, is whether I can hook into any existing
functionality to extract the static parts of the URI, to build up an "event
name" (if you will). I can do this by hand, but then there's a maintenance
problem waiting to happen (as I'm maintaining URI info in two places -- here,
and then also in the code-level annotations).