Immediately flush the console log

This commit is contained in:
Kai S. K. Engelbart 2020-06-11 12:14:20 +02:00
parent eb880f5593
commit cc17131003

View File

@ -60,7 +60,17 @@ public class EnvoyLog {
} catch (SecurityException | IOException e) {
e.printStackTrace();
}
consoleHandler = new StreamHandler(System.out, formatter);
consoleHandler = new StreamHandler(System.out, formatter) {
/**
* {@inheritDoc}
*/
@Override
public synchronized void publish(LogRecord record) {
super.publish(record);
flush();
}
};
consoleHandler.setLevel((Level) config.get("consoleLevelBarrier").get());
consoleHandler.setFormatter(formatter);