From 10789abd57fc90bc4b5f6cf94c34cfc98c9a7705 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Thu, 6 Feb 2020 10:51:20 -0700 Subject: [PATCH 1/2] Plugin error stack traces Because of how the Log4J2 api works exception stack traces were not being printed. Update to use the explicit "throwable" overloaded methods. Signed-off-by: Danno Ferrin --- .../besu/services/BesuPluginContextImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java b/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java index 791edb39506..aca01d08e39 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java @@ -96,8 +96,9 @@ public void registerPlugins(final Path pluginsDir) { addPluginVersion(plugin); } catch (final Exception e) { LOG.error( - "Error registering plugin of type {}, start and stop will not be called. \n{}", - plugin.getClass(), + "Error registering plugin of type " + + plugin.getClass() + + ", start and stop will not be called.", e); continue; } @@ -140,9 +141,7 @@ public void startPlugins() { LOG.debug("Started plugin of type {}.", plugin.getClass().getName()); } catch (final Exception e) { LOG.error( - "Error starting plugin of type {}, stop will not be called. \n{}", - plugin.getClass(), - e); + "Error starting plugin of type " + plugin.getClass() + ", stop will not be called.", e); pluginsIterator.remove(); } } @@ -164,7 +163,7 @@ public void stopPlugins() { plugin.stop(); LOG.debug("Stopped plugin of type {}.", plugin.getClass().getName()); } catch (final Exception e) { - LOG.error("Error stopping plugin of type {}. \n{}", plugin.getClass(), e); + LOG.error("Error stopping plugin of type " + plugin.getClass(), e); } } From eea36b991f23d346e523749c4eab575be39036de Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Thu, 6 Feb 2020 11:57:31 -0700 Subject: [PATCH 2/2] just the name, not the tostring Signed-off-by: Danno Ferrin --- .../hyperledger/besu/services/BesuPluginContextImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java b/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java index aca01d08e39..2a5531be785 100644 --- a/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java +++ b/besu/src/main/java/org/hyperledger/besu/services/BesuPluginContextImpl.java @@ -97,7 +97,7 @@ public void registerPlugins(final Path pluginsDir) { } catch (final Exception e) { LOG.error( "Error registering plugin of type " - + plugin.getClass() + + plugin.getClass().getName() + ", start and stop will not be called.", e); continue; @@ -141,7 +141,10 @@ public void startPlugins() { LOG.debug("Started plugin of type {}.", plugin.getClass().getName()); } catch (final Exception e) { LOG.error( - "Error starting plugin of type " + plugin.getClass() + ", stop will not be called.", e); + "Error starting plugin of type " + + plugin.getClass().getName() + + ", stop will not be called.", + e); pluginsIterator.remove(); } } @@ -163,7 +166,7 @@ public void stopPlugins() { plugin.stop(); LOG.debug("Stopped plugin of type {}.", plugin.getClass().getName()); } catch (final Exception e) { - LOG.error("Error stopping plugin of type " + plugin.getClass(), e); + LOG.error("Error stopping plugin of type " + plugin.getClass().getName(), e); } }