addTimestamp(sb, record.getMillis()); sb.append(formatMessage(record));
addTimestamp(sb, record.getMillis()); sb.append(getThreadName(record.getThreadID())); } else { sb.append(Thread.currentThread().getName()); sb.append(formatMessage(record));
addTimestamp(sb, new Date(record.getMillis()));
public void addTimestamp(StringBuilder buf, Date date) { if (currentDate != date) { synchronized (this) { if (currentDate != date) { StringBuilder current = new StringBuilder(32); current.append(dayFormatter.format(date)); // Day current.append('-'); current.append(lookup(monthFormatter.format(date))); // Month current.append('-'); current.append(yearFormatter.format(date)); // Year current.append(' '); current.append(timeFormatter.format(date)); // Time currentDateString = current.toString(); currentDate = date; } } } buf.append(currentDateString); }
} catch (Exception e) { setFormatter(new OneLineFormatter()); setFormatter(new OneLineFormatter());
public OneLineFormatter() { String timeFormat = LogManager.getLogManager().getProperty( OneLineFormatter.class.getName() + ".timeFormat"); if (timeFormat == null) { timeFormat = DEFAULT_TIME_FORMAT; } setTimeFormat(timeFormat); }
addTimestamp(sb, record.getMillis()); sb.append(getThreadName(record.getThreadID())); } else { sb.append(Thread.currentThread().getName()); sb.append(formatMessage(record));
addTimestamp(sb, new Date(record.getMillis()));
public void addTimestamp(StringBuilder buf, Date date) { if (currentDate != date) { synchronized (this) { if (currentDate != date) { StringBuilder current = new StringBuilder(32); current.append(dayFormatter.format(date)); // Day current.append('-'); current.append(lookup(monthFormatter.format(date))); // Month current.append('-'); current.append(yearFormatter.format(date)); // Year current.append(' '); current.append(timeFormatter.format(date)); // Time currentDateString = current.toString(); currentDate = date; } } } buf.append(currentDateString); }
} catch (Exception e) { setFormatter(new OneLineFormatter()); setFormatter(new OneLineFormatter());
public OneLineFormatter() { String timeFormat = LogManager.getLogManager().getProperty( OneLineFormatter.class.getName() + ".timeFormat"); if (timeFormat == null) { timeFormat = DEFAULT_TIME_FORMAT; } setTimeFormat(timeFormat); }
addTimestamp(sb, record.getMillis()); sb.append(getThreadName(record.getThreadID())); } else { sb.append(Thread.currentThread().getName()); sb.append(formatMessage(record));
addTimestamp(sb, record.getMillis()); sb.append(formatMessage(record));
addTimestamp(sb, new Date(record.getMillis()));
public void addTimestamp(StringBuilder buf, Date date) { if (currentDate != date) { synchronized (this) { if (currentDate != date) { StringBuilder current = new StringBuilder(32); current.append(dayFormatter.format(date)); // Day current.append('-'); current.append(lookup(monthFormatter.format(date))); // Month current.append('-'); current.append(yearFormatter.format(date)); // Year current.append(' '); current.append(timeFormatter.format(date)); // Time currentDateString = current.toString(); currentDate = date; } } } buf.append(currentDateString); }
} catch (Exception e) { setFormatter(new OneLineFormatter()); setFormatter(new OneLineFormatter());
addTimestamp(sb, record.getMillis()); sb.append(formatMessage(record));
addTimestamp(sb, record.getMillis()); sb.append(formatMessage(record));