[logback-user] Setting custom Profiler log level.
César Álvarez Núñez
cesar.alvarez.nunez at gmail.com
Tue Dec 27 10:30:11 CET 2011
The solution based on a filter has a problem since all our "if
(logger.isDebugEnabled())" will return true when it should return false in
the "production" env.
/César.
2011/12/27 César Álvarez Núñez <cesar.alvarez.nunez at gmail.com>
> Hi all,
>
> Our application makes an intensive use of Profiler (
> http://www.slf4j.org/extensions.html#profiler).
> It has been very useful during the development stage an we would like to
> keep it at production stage but there is a problem since its "log level" is
> hard-coded to "debug".
>
> Currently the profiler use the same application class logger so if log
> level is set to "info" in our production environment we lose the "profiler"
> log :-(
>
> Alternatives:
>
> - Use different loggers for application and profiler >-->> It requires
> to refactoring all the code and remember that any new Profiler that will be
> used need to set a custom logger instead of the default class logger.
>
> - Open a request to modify Profiler in order to set a custom log level.
>
> - Keep minimum log level to "debug" and make use of a Filter to accept
> any log event with marker=PROFILER, otherwise only accept if log level >=
> INFO >-->> It only will work with LogBack but Profiler belongs to SLF4J so
> it should work with any bridge.
>
> Any other way?
>
> BR,
> /César.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111227/fec06fc8/attachment.html>
More information about the Logback-user
mailing list