From 023b8b583e6cc92522ec77a4e2aed1fe711e7a08 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 9 Dec 2019 16:25:02 +0000 Subject: [PATCH] [Java] Print timestamp with stacktraces in DEFAULT_ERROR_HANDLER --- aeron-client/src/main/java/io/aeron/Aeron.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/aeron-client/src/main/java/io/aeron/Aeron.java b/aeron-client/src/main/java/io/aeron/Aeron.java index c29bf4cf3f..f9581bd150 100644 --- a/aeron-client/src/main/java/io/aeron/Aeron.java +++ b/aeron-client/src/main/java/io/aeron/Aeron.java @@ -521,12 +521,16 @@ public static class Configuration public static final ErrorHandler DEFAULT_ERROR_HANDLER = (throwable) -> { - throwable.printStackTrace(); - if (throwable instanceof DriverTimeoutException) + synchronized (System.err) { - System.err.printf( - "%n***%n*** timeout for the Media Driver - is it currently running? exiting%n***%n"); - System.exit(-1); + System.err.println(System.currentTimeMillis() + " Exception:"); + throwable.printStackTrace(); + if (throwable instanceof DriverTimeoutException) + { + System.err.printf( + "%n***%n*** timeout for the Media Driver - is it currently running? exiting%n***%n"); + System.exit(-1); + } } };