From 4e04b64740e4a43d3f39f8e4fb289c2023129bfe Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Tue, 6 Jun 2023 12:56:08 -0700 Subject: [PATCH] Don't set the error manager on the Handler and use the error manager from this ExtHandler. Signed-off-by: James R. Perkins --- src/main/java/org/jboss/logmanager/ExtHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jboss/logmanager/ExtHandler.java b/src/main/java/org/jboss/logmanager/ExtHandler.java index 6b73f5bc..12ff31c8 100644 --- a/src/main/java/org/jboss/logmanager/ExtHandler.java +++ b/src/main/java/org/jboss/logmanager/ExtHandler.java @@ -52,7 +52,7 @@ public abstract class ExtHandler extends Handler implements AutoCloseable, Flush private volatile Filter filter; private volatile Formatter formatter; private volatile Level level = Level.ALL; - private volatile ErrorManager errorManager = new ErrorManager(); + private volatile ErrorManager errorManager; // (skip `encoding` because we replace it with `charset` below) private volatile boolean autoFlush = true; @@ -79,7 +79,7 @@ public abstract class ExtHandler extends Handler implements AutoCloseable, Flush protected ExtHandler() { handlersUpdater.clear(this); closeChildren = true; - super.setErrorManager(DEFAULT_ERROR_MANAGER); + errorManager = DEFAULT_ERROR_MANAGER; } /** {@inheritDoc} */ @@ -526,7 +526,8 @@ public boolean isCallerCalculationRequired() { @Override protected void reportError(String msg, Exception ex, int code) { - super.reportError(msg, ex, code); + final ErrorManager errorManager = this.errorManager; + errorManager.error(msg, ex, code); } /**