Package ch.qos.logback.core.util

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


            + "timestamp-context.xml";
    configure(configFileAsStr);

    String r = loggerContext.getProperty("testTimestamp");
    assertNotNull(r);
    CachingDateFormatter sdf = new CachingDateFormatter("yyyy-MM");
    String expected = sdf.format(System.currentTimeMillis());
    assertEquals("expected \"" + expected + "\" but got " + r, expected, r);
  }
View Full Code Here


      return;

    String scopeStr = attributes.getValue(SCOPE_ATTRIBUTE);
    Scope scope = ActionUtil.stringToScope(scopeStr);
   
    CachingDateFormatter sdf = new CachingDateFormatter(datePatternStr);
    String val = sdf.format(timeReference);

    addInfo("Adding property to the context with key=\"" + keyStr
        + "\" and value=\"" + val + "\" to the " + scope + " scope");
    ActionUtil.setProperty(ec, keyStr, val, scope);
  }
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 (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.CLF_DATE_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

      String secondOption = optionList.get(1);
      if(AUXILIARY_TOKEN.equalsIgnoreCase(secondOption)) {
        primary = false;
      }
    }
    cdf = new CachingDateFormatter(datePattern);
  }
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);
      addWarn("Defaulting to  " + CoreConstants.CLF_DATE_PATTERN);
      cachingDateFormatter = new CachingDateFormatter(CoreConstants.CLF_DATE_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.CLF_DATE_PATTERN);
    }
   
    List optionList = getOptionList();
   
    // if the option list contains a TZ option, then set it.
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.