Hi,

For some time now we've been using slf4j with pax logging with the sift 
appender sending data to a file per bundle.
We have now started using Spring AOP for logging - which involves using a 
separate class for logging, with Spring injecting that class at the configured 
AOP points.
This works, but leaves us with a problem - the logging class belongs in its own 
bundle, but when we move it to its own bundle the sift appender always uses 
that bundle for the AOP logging files - everything gets dumped in one file.

The root of the problem seems to be in OSGIPaxLoggingManager.getLogger, where 
it calls BundleHelper.getCallerBundle before creating a new TrackingLogger.
The call to BundleHelper.getCallerBundle walks its way up through a stack of 
contexts until it finds the first different bundle - so it ignores the pax 
bundle, but hits our bundle.

What we need to do is either persuade getCallerBundle to skip a bundle, or to 
have a way to change the bundle recorded in a running Logger.

Is there any way around this?

I don't mind either writing more complex code on our side (including not using 
slf4j if that would help), or submitting a patch to Pax Logging if someone can 
suggest an elegant general purpose fix.

Sifting based on a different key isn't really viable because of the amount of 
change it would require to ensure that we got that different key set correctly 
in the MDC for every thread.

Thanks

Jim

_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to