[logback-user] How to get list of configured loggers

ceki ceki at qos.ch
Tue Jun 4 09:16:08 CEST 2013


Hi Reddy,

The logback/slf4j equivalent would be:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.qos.logback.classic.LoggerContext;

LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
context.reset();

See also http://logback.qos.ch/manual/configuration.html

I hope this helps,


On 04.06.2013 09:06, Govardhana wrote:
> Hello,
>
> I am new to logback. I am migrating my project from log4j to logback. My
> question is
> How to get list of configured loggers into one object?
>
> Current code using log4j:
>          Logger rootLogger =Logger.getRootLogger();
>          LoggerRepository currentRepository =
> rootLogger.getLoggerRepository();
>          currentRepository.resetConfiguration();
>
> How i can use the same in logback?
>
> Thanks in Advance.
>
> Regards,
> Reddy
>
>
>
> --
> View this message in context: http://logback.10977.n7.nabble.com/How-to-get-list-of-configured-loggers-tp12419.html
> Sent from the Users mailing list archive at Nabble.com.
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>


-- 
Ceki
65% of statistics are made up on the spot


More information about the Logback-user mailing list