Mercurial Hosting > luan
view src/goodjava/logger/DateLayout.java @ 1930:2b5eccebddd9
increase read timeout for sse
| author | fffilimonov |
|---|---|
| date | Fri, 02 May 2025 14:20:56 +0300 |
| parents | 6fc083e1d08c |
| children | 1cdc12cdcfa2 |
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(); private 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); } }
