[slf4j-dev] Resolving function a logging method is called from

Chetan Mehrotra chetan.mehrotra at gmail.com
Fri Feb 14 09:46:55 CET 2014


This would be mostly done by actual Logging system and not in Slf4j.
For example in Logback this is done in CallerData [1] class. You can
use the approach taken there

Chetan Mehrotra
[1] https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/java/ch/qos/logback/classic/spi/CallerData.java#L58-58


On Fri, Feb 14, 2014 at 2:06 PM, Björn Gerhart <oss at airbjorn.de> wrote:
> Dear developers,
>
> I'm evaluating slf4j for usage with Java Reflections. But when using
> slf4j in this way, the function where the method (e.g. debug) is called
> from does not get resolved properly, probably because of the additional
> abstraction.
>
> So now, I'm searching the slf4j source code where the calling function
> gets resolved, in order to improve my code in turn. Yet I didn't find
> the relevant part in slf4j where this happens. Could you please give me
> a hint pointing to the relevant part, or describe the selected solution
> therefore?
>
> Cheers
>   Björn Gerhart
> _______________________________________________
> slf4j-dev mailing list
> slf4j-dev at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-dev


More information about the slf4j-dev mailing list