One way would be to use filters, assuming you have access to the information required decide to output to the appender in that filter. And the mapped diagnostic context (MDC) could provide that information if you have no easier way.
On Feb 22, 2013, at 5:01 AM, Randall Wood <[email protected]> wrote: > I have a program that I am converting from Log4J to SLF4J, and have some > logic paths that, in a couple of situations, mute output from a single Logger > in a method, and then restoring the Logger to the user-selected logging level > at the end of the method. > > Is there any way to temporarily disable output from a single Logger in SLF4J? > > Currently I am getting around this by setting a flag in the class to disable > logging, and wrapping every logging statement in the affected methods with an > if statement testing that flag, but would prefer some other method if one is > available. > > Randall Wood > Alexandria Software > 202.683.8604 > [email protected] > http://www.alexandriasoftware.com > > _______________________________________________ > slf4j-user mailing list > [email protected] > http://mailman.qos.ch/mailman/listinfo/slf4j-user _______________________________________________ slf4j-user mailing list [email protected] http://mailman.qos.ch/mailman/listinfo/slf4j-user
