Package ch.qos.logback.core

Examples of ch.qos.logback.core.Context


    if (optionList != null && optionList.size() > 1) {
      final int optionListSize = optionList.size();
      for (int i = 1; i < optionListSize; i++) {
        String evaluatorStr = (String) optionList.get(i);
        Context context = getContext();
        Map evaluatorMap = (Map) context.getObject(CoreConstants.EVALUATOR_MAP);
        EventEvaluator<ILoggingEvent> ee = (EventEvaluator<ILoggingEvent>) evaluatorMap
                .get(evaluatorStr);
        addEvaluator(ee);
      }
    }
View Full Code Here


    if (optionList != null && optionList.size() > 1) {
      final int optionListSize = optionList.size();
      for (int i = 1; i < optionListSize; i++) {
        String evaluatorStr = (String) optionList.get(i);
        Context context = getContext();
        if (context != null) {
          Map evaluatorMap = (Map) context
              .getObject(CoreConstants.EVALUATOR_MAP);
          EventEvaluator<ILoggingEvent> ee = (EventEvaluator<ILoggingEvent>) evaluatorMap
              .get(evaluatorStr);
          if (ee != null) {
            addEvaluator(ee);
View Full Code Here

  private LoggerContext configureLogging(final String workerName, final String logDirectory) throws EngineException {

    final ILoggerFactory iLoggerFactory = LoggerFactory.getILoggerFactory();

    if (iLoggerFactory instanceof Context) {
      final Context context = (Context) iLoggerFactory;
      final LoggerContext result = (LoggerContext) iLoggerFactory;

      final JoranConfigurator configurator = new JoranConfigurator();
      configurator.setContext(context);
      context.putProperty("WORKER_NAME", workerName);
      context.putProperty("LOG_DIRECTORY", logDirectory);

      try {
        configurator.doConfigure(GrinderProcess.class.getResource("/logback-worker.xml"));
      } catch (final JoranException e) {
        throw new EngineException("Could not initialise logger", e);
View Full Code Here

      return null;

    if (rollingPolicy instanceof RollingPolicyBase) {
      RollingPolicyBase policy = (RollingPolicyBase) rollingPolicy;
      String fileNamePattern = policy.getFileNamePattern();
      Context context = rollingFileAppender.getContext();

      File dir = null;
      FileNamePattern pattern = new FileNamePattern(fileNamePattern,
          context);
      Path path = new Path(pattern.toRegex(new Date()));
View Full Code Here

    if (defaultMap != null) {
      effectiveMap.putAll(defaultMap);
    }
   
    // contextMap is more specific than the default map
    Context context = getContext();
    if (context != null) {
      Map<String, String> contextMap = (Map) context.getObject(CoreGlobal.PATTERN_RULE_REGISTRY);
      if (contextMap != null) {
        effectiveMap.putAll(contextMap);
      }
    }
   
View Full Code Here

  protected void postCompileProcessing(Converter<E> head) {
  }
 
  protected void setContextForConverters(Converter<E> head) {
   
    Context context = getContext();
    Converter c = head;
    while (c != null) {
      if (c instanceof ContextAware) {
        ((ContextAware) c).setContext(context);
      }
View Full Code Here

    if (defaultMap != null) {
      effectiveMap.putAll(defaultMap);
    }
   
    // contextMap is more specific than the default map
    Context context = getContext();
    if (context != null) {
      Map<String, String> contextMap = (Map) context.getObject(CoreConstants.PATTERN_RULE_REGISTRY);
      if (contextMap != null) {
        effectiveMap.putAll(contextMap);
      }
    }
   
View Full Code Here

      PostCompileProcessor<E> postCompileProcessor) {
    this.postCompileProcessor = postCompileProcessor;
  }
 
  protected void setContextForConverters(Converter<E> head) {
    Context context = getContext();
    Converter c = head;
    while (c != null) {
      if (c instanceof ContextAware) {
        ((ContextAware) c).setContext(context);
      }
View Full Code Here

    if (optionList != null && optionList.size() > 1) {
      final int optionListSize = optionList.size();
      for (int i = 1; i < optionListSize; i++) {
        String evaluatorStr = (String) optionList.get(i);
        Context context = getContext();
        Map evaluatorMap = (Map) context.getObject(CoreGlobal.EVALUATOR_MAP);
        EventEvaluator ee = (EventEvaluator) evaluatorMap.get(evaluatorStr);
        addEvaluator(ee);
      }
    }
    super.start();
View Full Code Here

    if (defaultMap != null) {
      effectiveMap.putAll(defaultMap);
    }

    // contextMap is more specific than the default map
    Context context = getContext();
    if (context != null) {
      @SuppressWarnings("unchecked")
      Map<String, String> contextMap = (Map<String, String>) context
          .getObject(CoreConstants.PATTERN_RULE_REGISTRY);
      if (contextMap != null) {
        effectiveMap.putAll(contextMap);
      }
    }
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.Context

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.