package net.pterodactylus.util.logging;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
consoleHandler.setLevel(Level.ALL);
consoleHandler.setFormatter(new Formatter() {
private StringBuffer recordBuffer = new StringBuffer();
+ private DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS Z");
/**
* {@inheritDoc}
*/
@Override
public synchronized String format(LogRecord record) {
recordBuffer.setLength(0);
- recordBuffer.append(new Date(record.getMillis())).append(' ').append(record.getLevel().getName()).append(' ');
+ recordBuffer.append(dateFormatter.format(new Date(record.getMillis()))).append(' ').append(record.getLevel().getName()).append(' ');
recordBuffer.append(record.getSourceClassName()).append('.').append(record.getSourceMethodName()).append(' ');
recordBuffer.append(record.getMessage());
recordBuffer.append("\r\n");