Immediately flush the console log

This commit is contained in:
Kai S. K. Engelbart 2020-06-11 12:14:20 +02:00
parent b92a1630a1
commit 1026ca4f8d
1 changed files with 11 additions and 1 deletions

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);