From: Victor Kirhenshtein Date: Mon, 26 Sep 2016 08:54:48 +0000 (+0300) Subject: added exception stack trace logging in Java subagent X-Git-Tag: 2.1-M1~38 X-Git-Url: http://git.netxms.org/public/netxms.git/commitdiff_plain/36f3cf398d3de5cee7fede8691f816bf27d6e87b?hp=b5dd73893488ce1919189af3caeaab5f94db220a added exception stack trace logging in Java subagent --- diff --git a/src/agent/subagents/java/java/src/main/java/org/netxms/agent/SubAgent.java b/src/agent/subagents/java/java/src/main/java/org/netxms/agent/SubAgent.java index 1b5316e6a..407956e84 100644 --- a/src/agent/subagents/java/java/src/main/java/org/netxms/agent/SubAgent.java +++ b/src/agent/subagents/java/java/src/main/java/org/netxms/agent/SubAgent.java @@ -97,6 +97,7 @@ public class SubAgent catch(Throwable e) { writeLog(LogLevel.ERROR, "JAVA: Exception in loadPlugin: " + e.getClass().getCanonicalName() + ": " + e.getMessage()); + writeDebugLog(6, "JAVA: ", e); } } } @@ -188,6 +189,7 @@ public class SubAgent catch(Throwable e) { writeDebugLog(2, "JAVA: exception in plugin " + entry.getKey() + " initialization handler: " + e.getClass().getCanonicalName() + ": " + e.getMessage()); + writeDebugLog(6, "JAVA: ", e); } } writeDebugLog(2, "JAVA: subagent initialization completed"); @@ -210,6 +212,7 @@ public class SubAgent catch(Throwable e) { writeDebugLog(2, "JAVA: exception in plugin " + entry.getKey() + " shutdown handler: " + e.getClass().getCanonicalName() + ": " + e.getMessage()); + writeDebugLog(6, "JAVA: ", e); } } writeDebugLog(2, "JAVA: subagent shutdown completed"); @@ -288,6 +291,7 @@ public class SubAgent catch(Throwable e) { writeLog(LogLevel.WARNING, "Failed to load plugin " + classname + ": " + e.getClass().getCanonicalName() + ": " + e.getMessage()); + writeDebugLog(6, "JAVA: ", e); return null; } } @@ -320,6 +324,7 @@ public class SubAgent catch(Throwable e) { writeLog(LogLevel.WARNING, "Error processing jar file " + jarFile + ": " + e.getClass().getCanonicalName() + ": " + e.getMessage()); + writeDebugLog(6, "JAVA: ", e); return null; } @@ -337,6 +342,7 @@ public class SubAgent catch(Throwable e) { writeLog(LogLevel.WARNING, "Failed to load plugin " + cn + " from jar file " + jarFile + ": " + e.getClass().getCanonicalName() + ": " + e.getMessage()); + writeDebugLog(6, "JAVA: ", e); } } return pluginList.toArray(new Plugin[pluginList.size()]);