|
|
Re: Logging the bundle name [message #652177 is a reply to message #645023] |
Wed, 02 February 2011 21:32 |
Raman Gupta Messages: 12 Registered: December 2010 |
Junior Member |
|
|
How about adding the bundle information to the MDC within the proxies generated for OSGi service calls?
i.e.
try {
MDC.put("Bundle-SymbolicName", ...);
MDC.put("Bundle-ID", ...);
<service call here>
} finally {
MDC.remove("Bundle-SymbolicName");
MDC.remove("Bundle-ID");
}
Glyn - is this what you were thinking of when you said that it could be done but you were concerned about overhead?
Cheers,
Raman
[Updated on: Wed, 02 February 2011 21:32] Report message to a moderator
|
|
|
|
Re: Logging the bundle name [message #652183 is a reply to message #652178] |
Wed, 02 February 2011 22:11 |
Raman Gupta Messages: 12 Registered: December 2010 |
Junior Member |
|
|
It probably would but only for exceptions, and only those exceptions which I specifically instrumented. What would be better is a generic solution that would work for all logging messages.
What do you think about the approach I described? The only overhead would be the MDC put and release calls on each service call. Unfortunately, it won't cover every situation -- for example, code that runs outside the context of a service call, but it would help nonetheless.
Cheers,
Raman
[Updated on: Wed, 02 February 2011 22:29] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04889 seconds