Package ch.qos.logback.core.util

Examples of ch.qos.logback.core.util.CachingDateFormatter


  public void start() {
    this.datePattern = getFirstOption();
    if (this.datePattern == null) {
      this.datePattern = DEFAULT_DATE_PATTERN;
    }
    cdf = new CachingDateFormatter(datePattern);
  }
View Full Code Here



    if (inError)
      return;

    CachingDateFormatter sdf = new CachingDateFormatter(datePatternStr);
    String val = sdf.format(timeReference);

    addInfo("Adding property to the context with key=\"" + keyStr
        + "\" and value=\"" + val + "\" to the context");
    context.putProperty(keyStr, val);
  }
View Full Code Here

      String secondOption = optionList.get(1);
      if(AUXILIARY_TOKEN.equalsIgnoreCase(secondOption)) {
        primary = false;
      }
    }
    cdf = new CachingDateFormatter(datePattern);
  }
View Full Code Here


    if (inError)
      return;

    CachingDateFormatter sdf = new CachingDateFormatter(datePatternStr);
    String val = sdf.format(timeReference);

    addInfo("Adding property to the context with key=\"" + keyStr
        + "\" and value=\"" + val + "\" to the context");
    context.putProperty(keyStr, val);
  }
View Full Code Here

  public void start() {
    this.datePattern = getFirstOption();
    if (this.datePattern == null) {
      this.datePattern = DEFAULT_DATE_PATTERN;
    }
    cdf = new CachingDateFormatter(datePattern);
  }
View Full Code Here


    if (inError)
      return;

    CachingDateFormatter sdf = new CachingDateFormatter(datePatternStr);
    String val = sdf.format(timeReference);

    addInfo("Adding property to the context with key=\"" + keyStr
        + "\" and value=\"" + val + "\" to the context");
    context.putProperty(keyStr, val);
  }
View Full Code Here

    if (datePattern.equals(CoreConstants.ISO8601_STR)) {
      datePattern = CoreConstants.ISO8601_PATTERN;
    }

    try {
      cachingDateFormatter = new CachingDateFormatter(datePattern);
      // maximumCacheValidity =
      // CachedDateFormat.getMaximumCacheValidity(pattern);
    } catch (IllegalArgumentException e) {
      addWarn("Could not instantiate SimpleDateFormat with pattern "
          + datePattern, e);
      // default to the ISO8601 format
      cachingDateFormatter = new CachingDateFormatter(CoreConstants.ISO8601_PATTERN);
    }

    List optionList = getOptionList();

    // if the option list contains a TZ option, then set it.
View Full Code Here

    if (datePattern.equals(CoreConstants.ISO8601_STR)) {
      datePattern = CoreConstants.ISO8601_PATTERN;
    }

    try {
      cachingDateFormatter = new CachingDateFormatter(datePattern);
      // maximumCacheValidity =
      // CachedDateFormat.getMaximumCacheValidity(pattern);
    } catch (IllegalArgumentException e) {
      addWarn("Could not instantiate SimpleDateFormat with pattern "
          + datePattern, e);
      // default to the ISO8601 format
      cachingDateFormatter = new CachingDateFormatter(CoreConstants.ISO8601_PATTERN);
    }

    List optionList = getOptionList();

    // if the option list contains a TZ option, then set it.
View Full Code Here

          timeZone = TimeZone.getTimeZone(option);
        }
      }
    }

    cdf = new CachingDateFormatter(datePattern);
    if (timeZone != null) {
      cdf.setTimeZone(timeZone);
    }
  }
View Full Code Here

  }

  @Test
  public void basic() throws Exception {
    loadConfig(ClassicTestConstants.JORAN_INPUT_PREFIX + "unique.xml");
    CachingDateFormatter sdf = new CachingDateFormatter("yyyyMMdd'T'HHmmss");
    String timestamp = sdf.format(System.currentTimeMillis());

    sc.assertIsErrorFree();

    Logger root = lc.getLogger(Logger.ROOT_LOGGER_NAME);
    root.info("hello");
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.util.CachingDateFormatter

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.