Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Logback: the reliable, generic, fast and flexible logging framework. Copyright (C) 1999-2011, QOS.ch. All rights reserved. This program and the accompanying materials are dual-licensed under either the terms of the Eclipse Public License v1.0 as published by the Eclipse Foundation or (per the licensee's choosing) under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation.
package ch.qos.logback.classic.pattern;
public class DateConverter extends ClassicConverter {
  long lastTimestamp = -1;
  public void start() {
    String datePattern = getFirstOption();
    if (datePattern == null) {
      datePattern = .;
    }
    if (datePattern.equals(.)) {
      datePattern = .;
    }
    try {
       = new CachingDateFormatter(datePattern);
      // maximumCacheValidity =
      // CachedDateFormat.getMaximumCacheValidity(pattern);
    } catch (IllegalArgumentException e) {
      addWarn("Could not instantiate SimpleDateFormat with pattern "
          + datePatterne);
      // default to the ISO8601 format
    }
    List optionList = getOptionList();
    // if the option list contains a TZ option, then set it.
    if (optionList != null && optionList.size() > 1) {
      TimeZone tz = TimeZone.getTimeZone((StringoptionList.get(1));
    }
  }
  public String convert(ILoggingEvent le) {
    long timestamp = le.getTimeStamp();
    return .format(timestamp);
  }
New to GrepCode? Check out our FAQ X