Examples of ILoggerFactory


Examples of org.slf4j.ILoggerFactory

        configurator.setContext(getLoggerContext(props));
        configurator.doConfigure(configFile);
    }

    private LoggerContext getLoggerContext(Map<String, String> props) {
        ILoggerFactory lcObject = LoggerFactory.getILoggerFactory();

        if (!(lcObject instanceof LoggerContext)) {
            throw new LogbackException(
                    "Expected LOGBACK binding with SLF4J, but another log system has taken the place: "
                    + lcObject.getClass().getSimpleName());
        }

        LoggerContext lc = (LoggerContext) lcObject;

        lc.reset();
View Full Code Here

Examples of org.slf4j.ILoggerFactory

        configurator.setContext(getLoggerContext(props));
        configurator.doConfigure(configFile);
    }

    private LoggerContext getLoggerContext(Map<String, String> props) {
        ILoggerFactory lcObject = LoggerFactory.getILoggerFactory();

        if (!(lcObject instanceof LoggerContext)) {
            throw new LogbackException(
                    "Expected LOGBACK binding with SLF4J, but another log system has taken the place: "
                            + lcObject.getClass().getSimpleName());
        }

        LoggerContext lc = (LoggerContext) lcObject;

        lc.reset();
View Full Code Here

Examples of org.slf4j.ILoggerFactory

  public static final String LOCATION_PREFIX_CLASSPATH = "classpath:";

  public void contextInitialized(ServletContextEvent sce)
  {
    ServletContext sc = sce.getServletContext();
    ILoggerFactory ilc = LoggerFactory.getILoggerFactory();

    if (!(ilc instanceof LoggerContext))
    {
      sc.log("Can not configure logback. " + LoggerFactory.class + " is using " + ilc +
        " which is not an instance of " + LoggerContext.class);
View Full Code Here

Examples of org.slf4j.ILoggerFactory

    return url;
  }

  public void contextDestroyed(ServletContextEvent sce)
  {
    ILoggerFactory ilc = LoggerFactory.getILoggerFactory();

    if (!(ilc instanceof LoggerContext))
      return;

    LoggerContext lc = (LoggerContext)ilc;
View Full Code Here

Examples of org.slf4j.ILoggerFactory

        reconnectAppender();
    }

    @Override
    public void reconnectAppender() {
        ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
        AppenderAttachable appenderAttachable = null;
        if (loggerFactory instanceof AppenderAttachable) {
            appenderAttachable = (AppenderAttachable) loggerFactory;
        }
        if (appenderAttachable == null) {
View Full Code Here

Examples of org.slf4j.ILoggerFactory

  public void initialize() {
    initialize(org.slf4j.Logger.ROOT_LOGGER_NAME);
  }

  public void initialize(String rootLoggerName) {
    ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
    // TODO: fix logging issue in mapreduce:  ENG-3279
    if (!(loggerFactory instanceof LoggerContext)) {
      LOG.warn("LoggerFactory is not a logback LoggerContext. No log appender is added. " +
                 "Logback might not be in the classpath");
    }
View Full Code Here

Examples of org.slf4j.ILoggerFactory

        return new Slf4jCougarLoggingImpl(loggerName);
    }

    @Override
    public void suppressAllRootLoggerOutput() {
        ILoggerFactory iLoggerFactory = LoggerFactory.getILoggerFactory();
        if (iLoggerFactory instanceof Log4jLoggerFactory) {
            org.apache.log4j.Logger.getRootLogger().addAppender(new org.apache.log4j.varia.NullAppender());
        }
    }
View Full Code Here

Examples of org.slf4j.ILoggerFactory

        }
    }

    @GET("/@/loggers")
    public Iterable<Logger> getLoggers() {
        ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
        if (loggerFactory instanceof LoggerContext) {
            LoggerContext context = (LoggerContext) loggerFactory;

            List<Logger> loggers = new ArrayList<>();
            for (ch.qos.logback.classic.Logger l : context.getLoggerList()) {
View Full Code Here

Examples of org.slf4j.ILoggerFactory

    @PUT("/@/loggers/{name}")
    public Logger updateLogger(String name, Logger logger) {
        logger.name = name;

        ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
        if (loggerFactory instanceof LoggerContext) {
            LoggerContext context = (LoggerContext) loggerFactory;
            context.getLogger(name).setLevel(Level.valueOf(logger.level));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.