From 61f3a374264b8e6c6c0d8bce6b05431c77fa7a06 Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Fri, 20 Apr 2018 17:28:08 +0200 Subject: [PATCH] fix logging of (supposedly) "CRITICAL" condition 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 https://github.com/KengoTODA/findbugs-slf4j/issues/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 --- .../org/opendaylight/infrautils/diagstatus/MBeanUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diagstatus/api/src/main/java/org/opendaylight/infrautils/diagstatus/MBeanUtils.java b/diagstatus/api/src/main/java/org/opendaylight/infrautils/diagstatus/MBeanUtils.java index 9c4554825..160b14252 100644 --- a/diagstatus/api/src/main/java/org/opendaylight/infrautils/diagstatus/MBeanUtils.java +++ b/diagstatus/api/src/main/java/org/opendaylight/infrautils/diagstatus/MBeanUtils.java @@ -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; } @@ -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; }