Package ch.qos.logback.classic

Examples of ch.qos.logback.classic.Logger


    }
   
    loggerName = loggerName.trim();
   
    LoggerContext lc = (LoggerContext) context;
    Logger logger = lc.exists(loggerName);
    if (logger != null) {
      return logger.getEffectiveLevel().toString();
    } else {
      return EMPTY;
    }
  }
View Full Code Here


  public List<String> getLoggerList() {
    LoggerContext lc = (LoggerContext)context;
    List<String> strList = new ArrayList<String>();
    Iterator<Logger> it = lc.getLoggerList().iterator();
    while(it.hasNext()) {
      Logger log = it.next();
      strList.add(log.getName());
    }
    return strList;
  }
View Full Code Here

    levelStr = levelStr.trim();
   
    addInfo("Trying to set level " + levelStr + " to logger " + loggerName);
    LoggerContext lc = (LoggerContext) context;
   
    Logger logger = lc.getLogger(loggerName);
    if ("null".equalsIgnoreCase(levelStr)) {
      logger.setLevel(null);
    } else {
      Level level = Level.toLevel(levelStr, null);
      if (level != null) {
        logger.setLevel(level);
      }
    }
  }
View Full Code Here

    }
   
    loggerName = loggerName.trim();
   
    LoggerContext lc = (LoggerContext) context;
    Logger logger = lc.exists(loggerName);
    if (logger != null) {
      return logger.getLevel().toString();
    } else {
      return EMPTY;
    }
  }
View Full Code Here

    }
   
    loggerName = loggerName.trim();
   
    LoggerContext lc = (LoggerContext) context;
    Logger logger = lc.exists(loggerName);
    if (logger != null) {
      return logger.getEffectiveLevel().toString();
    } else {
      return EMPTY;
    }
  }
View Full Code Here

  public List<String> getLoggerList() {
    LoggerContext lc = (LoggerContext)context;
    List<String> strList = new ArrayList<String>();
    Iterator<Logger> it = lc.getLoggerList().iterator();
    while(it.hasNext()) {
      Logger log = it.next();
      strList.add(log.getName());
    }
    return strList;
  }
View Full Code Here

    @Override
    protected void attach(final LoggerConfig config, final LoggerReporter<LoggerConfig> reporter) {

        // initialize
        final Logger rootLogger = (Logger) LoggerFactory.getLogger("ROOT");

        // attach
        myAppender = new CrashAppender(config, reporter);
        myAppender.setContext(rootLogger.getLoggerContext());
        rootLogger.addAppender(myAppender);
    }
View Full Code Here

        rootLogger.addAppender(myAppender);
    }

    @Override
    protected void detach() {
        final Logger rootLogger = (Logger) LoggerFactory.getLogger("ROOT");
        rootLogger.detachAppender(myAppender);
    }
View Full Code Here

    public boolean isEnabled() {
        return !appenders.isEmpty();
    }

    public RequestLog build(String name) {
        final Logger logger = (Logger) LoggerFactory.getLogger("http.request");
        logger.setAdditive(false);

        final LoggerContext context = logger.getLoggerContext();

        final RequestLogLayout layout = new RequestLogLayout();
        layout.start();

        final AppenderAttachableImpl<ILoggingEvent> attachable = new AppenderAttachableImpl<>();
View Full Code Here

                .getStackTracePattern()).isEqualTo("--->");
    }

    @Test
    public void appenderContextIsSet() throws Exception {
        final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
        final SyslogAppenderFactory appenderFactory = new SyslogAppenderFactory();
        final Appender<ILoggingEvent> appender = appenderFactory.build(root.getLoggerContext(), "test", null);

        assertThat(appender.getContext()).isEqualTo(root.getLoggerContext());
    }
View Full Code Here

TOP

Related Classes of ch.qos.logback.classic.Logger

Copyright © 2018 www.massapicom. 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.