Skip to content

Commit

Permalink
fix logging of (supposedly) "CRITICAL" condition
Browse files Browse the repository at this point in the history
if it's "CRITICAL", it most probably better be LOG.error() instead info,
and it would REALLY help to have the cause included; see also
KengoTODA/findbugs-slf4j#74.

actually, perhaps this really should re-throw... let me propose that in
a follow-up change, and we can discuss if there is any reason to only go
half the way or merge both steps.

Change-Id: Ie824d8e8b1155c6bfd604dd83da2969c4d9cdb33
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
  • Loading branch information
vorburger authored and Faseela K committed Apr 24, 2018
1 parent 2973a58 commit 61f3a37
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static Object invokeMBeanFunction(String objName, String functionName) {
MBeanServer mplatformMbeanServer = ManagementFactory.getPlatformMBeanServer();
udpated = mplatformMbeanServer.invoke(objectName, functionName, null, null);
} catch (InstanceNotFoundException | MBeanException | ReflectionException | MalformedObjectNameException t) {
LOG.info("CRITICAL : Exception in executing MBean function");
LOG.error("CRITICAL : Exception in executing MBean function", t);
}
return udpated;
}
Expand All @@ -148,7 +148,7 @@ public static Object readMBeanAttribute(String objName, String attribute) {
attributeObj = platformMbeanServer.getAttribute(objectName, attribute);
} catch (AttributeNotFoundException | InstanceNotFoundException | MBeanException
| ReflectionException | MalformedObjectNameException t) {
LOG.info("CRITICAL : Exception in executing MXBean function");
LOG.error("CRITICAL : Exception in executing MXBean function", t);
}
return attributeObj;
}
Expand Down

0 comments on commit 61f3a37

Please sign in to comment.