[slf4j-user] Proper use of XLogger

Aleks M maleks at gmail.com
Mon May 28 23:32:51 CEST 2012


Hello,
I have a class in which I want to trace the method calling flow using
XLogger entry() and exit().
Right now I have the following line in my class:

private final static Logger logger = LoggerFactory.getLogger("main");

I'm also using Logback together with SLF4J.

If I add the following, will this return the same logger as the first
line, since they have the same name?:

private final static XLogger trace = XLoggerFactory.getXLogger("main");

I'm asking since I only want XLogger to log when I turn up my regular
logger to TRACE level.

If I now add something like:
trace.entry(param1, param2); to each of my methods,
will I incur a heavy performance penalty when I have a log level less
than TRACE, e.g. ERROR? I'm asking because I can't parametrize the log
call like I can with a regular Logger.

Thanks



More information about the slf4j-user mailing list