view src/goodjava/logger/DateLayout.java @ 2133:c3b4c19f2d8a

attempt to autodetect and use nginx confs dir
author Violet7
date Fri, 16 Jan 2026 17:29:05 -0800
parents 1cdc12cdcfa2
children
line wrap: on
line source

package goodjava.logger;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;


public final class DateLayout implements Layout {
	private final Date date = new Date();
	public final DateFormat dateFormat;

	public DateLayout(String pattern) {
		dateFormat = new SimpleDateFormat(pattern);
	}

	public synchronized String format(LoggingEvent event) {
		date.setTime(event.time);
		return dateFormat.format(date);
	}
}