Package ch.qos.logback.core.util

Examples of ch.qos.logback.core.util.CachingDateFormatter.format()


    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 (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 (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

  @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

    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);
  }

  @Test
  public void timestampLocal() throws JoranException, IOException,
View Full Code Here

    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

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.