From: <rm...@hy...> - 2010-04-05 18:12:08
|
Author: rmorgan Date: 2010-04-05 11:12:00 -0700 (Mon, 05 Apr 2010) New Revision: 14476 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14476 Modified: trunk/src/org/hyperic/hq/product/jmx/MxNotificationListener.java trunk/src/org/hyperic/hq/product/jmx/MxNotificationPlugin.java Log: [HHQ-2933] Allow notification.getType() to set the event log level. Modified: trunk/src/org/hyperic/hq/product/jmx/MxNotificationListener.java =================================================================== --- trunk/src/org/hyperic/hq/product/jmx/MxNotificationListener.java 2010-04-05 17:14:41 UTC (rev 14475) +++ trunk/src/org/hyperic/hq/product/jmx/MxNotificationListener.java 2010-04-05 18:12:00 UTC (rev 14476) @@ -199,7 +199,22 @@ } long time = notification.getTimeStamp(); + + // Default level to INFO int level = LogTrackPlugin.LOGLEVEL_INFO; + + // Check notification.getType() for Error, Warn, Info, Debug (case insensitive) + String typeString = notification.getType(); + if(typeString != null) { + if(typeString.equalsIgnoreCase(LogTrackPlugin.LOGLEVEL_ERROR_LABEL)) { + level = LogTrackPlugin.LOGLEVEL_ERROR; + } else if(typeString.equals(LogTrackPlugin.LOGLEVEL_WARN_LABEL)) { + level = LogTrackPlugin.LOGLEVEL_WARN; + } else if(typeString.equals(LogTrackPlugin.LOGLEVEL_DEBUG_LABEL)) { + level = LogTrackPlugin.LOGLEVEL_DEBUG; + } + } + String source = notification.getSource().toString(); if (isAttrChange) { Modified: trunk/src/org/hyperic/hq/product/jmx/MxNotificationPlugin.java =================================================================== --- trunk/src/org/hyperic/hq/product/jmx/MxNotificationPlugin.java 2010-04-05 17:14:41 UTC (rev 14475) +++ trunk/src/org/hyperic/hq/product/jmx/MxNotificationPlugin.java 2010-04-05 18:12:00 UTC (rev 14476) @@ -44,9 +44,6 @@ super.configure(config); - //no concept of log levels in JMX notifications - setLogLevel(LOGLEVEL_INFO); - this.listener = MxNotificationListener.getInstance(this); @@ -88,6 +85,6 @@ } protected boolean supportsLogLevels() { - return false; + return true; } } |