Fix logging issues in alivenessmonitor 99/69499/2
authorsathwik boggarapu <b.sathwik@ericsson.com>
Wed, 14 Mar 2018 11:56:45 +0000 (17:26 +0530)
committerMichael Vorburger <vorburger@redhat.com>
Wed, 14 Mar 2018 19:15:11 +0000 (19:15 +0000)
Change-Id: I730efda2afc6ffbeed547737e47c980ae418ccd5
Signed-off-by: sathwik boggarapu <b.sathwik@ericsson.com>
alivenessmonitor/alivenessmonitor-impl-protocols/src/main/java/org/opendaylight/genius/alivenessmonitor/protocols/internal/AlivenessProtocolHandlerARP.java
alivenessmonitor/alivenessmonitor-impl/src/main/java/org/opendaylight/genius/alivenessmonitor/internal/AlivenessMonitor.java

index a268d15d343a6d8e5d955d8d91dc988e84d4ad99..c085f876297db41df035d367cac8ca08cd9fa4fb 100644 (file)
@@ -81,7 +81,7 @@ public class AlivenessProtocolHandlerARP extends AbstractAlivenessProtocolHandle
 
         if (arpType == ARP.REPLY) {
             if (LOG.isTraceEnabled()) {
-                LOG.trace("packet: {}, monitorKey {}", packetReceived);
+                LOG.trace("packet: {}", packetReceived);
             }
 
             BigInteger metadata = packetReceived.getMatch().getMetadata().getMetadata();
index 75e256d83f5fef45b29cca1c34198959d31bd675..2d456fbf33c4ec2b6e1770ac0e5ca1af9bf6b2ec 100644 (file)
@@ -261,7 +261,7 @@ public class AlivenessMonitor
             Future<RpcResult<Void>> result = idManager.releaseId(idInput);
             RpcResult<Void> rpcResult = result.get();
             if (!rpcResult.isSuccessful()) {
-                LOG.warn("RPC Call to release Id {} with Key {} returned with Errors {}", idKey, rpcResult.getErrors());
+                LOG.warn("RPC Call to release Id {} returned with Errors {}", idKey, rpcResult.getErrors());
             }
         } catch (InterruptedException | ExecutionException e) {
             LOG.warn("Exception when releasing Id for key {}", idKey, e);
@@ -499,7 +499,8 @@ public class AlivenessMonitor
                 String message = String.format(
                         "Monitoring for the interface %s with this configuration " + "is already registered.",
                         interfaceName);
-                LOG.warn(message);
+                LOG.warn("Monitoring for the interface {} with this configuration is already registered.",
+                        interfaceName);
                 MonitorStartOutput output = new MonitorStartOutputBuilder().setMonitorId(monitorId).build();
                 rpcResultBuilder = RpcResultBuilder.success(output).withWarning(ErrorType.APPLICATION, "config-exists",
                         message);
@@ -539,7 +540,7 @@ public class AlivenessMonitor
                     public void onFailure(Throwable error) {
                         String errorMsg = String.format("Adding Monitoring info: %s in Datastore failed",
                                 monitoringInfo);
-                        LOG.warn(errorMsg, error);
+                        LOG.warn("Adding Monitoring info: {} in Datastore failed", monitoringInfo, error);
                         throw new RuntimeException(errorMsg, error);
                     }
 
@@ -563,7 +564,7 @@ public class AlivenessMonitor
 
             rpcResultBuilder = RpcResultBuilder.success(output);
         } catch (UnsupportedConfigException e) {
-            LOG.error("Start Monitoring Failed. {}", e.getMessage(), e);
+            LOG.error("Start Monitoring Failed. ", e);
             rpcResultBuilder = RpcResultBuilder.<MonitorStartOutput>failed().withError(ErrorType.APPLICATION,
                     e.getMessage(), e);
         }
@@ -923,7 +924,7 @@ public class AlivenessMonitor
                             public void onFailure(Throwable error) {
                                 String msg = String.format("Error when storing monitorprofile %s in datastore",
                                         monitorProfile);
-                                LOG.error(msg, error);
+                                LOG.error("Error when storing monitorprofile {} in datastore", monitorProfile, error);
                                 returnFuture.set(RpcResultBuilder.<MonitorProfileCreateOutput>failed()
                                         .withError(ErrorType.APPLICATION, msg, error).build());
                             }
@@ -946,7 +947,7 @@ public class AlivenessMonitor
                 String msg = String.format("Error in creating monitorprofile - %s", input);
                 returnFuture.set(RpcResultBuilder.<MonitorProfileCreateOutput>failed()
                         .withError(ErrorType.APPLICATION, msg, error).build());
-                LOG.error(msg, error);
+                LOG.error("Error in creating monitorprofile - {} ", input, error);
             }
 
             @Override
@@ -1006,7 +1007,7 @@ public class AlivenessMonitor
                         public void onFailure(Throwable error) {
                             String msg = String.format("Error when removing monitor profile %d from datastore",
                                     profileId);
-                            LOG.error(msg, error);
+                            LOG.error("Error when removing monitor profile {} from datastore", profileId, error);
                             result.set(RpcResultBuilder.<Void>failed().withError(ErrorType.APPLICATION, msg, error)
                                     .build());
                         }
@@ -1035,7 +1036,7 @@ public class AlivenessMonitor
             @Override
             public void onFailure(Throwable error) {
                 String msg = String.format("Error when removing monitor profile %d from datastore", profileId);
-                LOG.error(msg, error);
+                LOG.error("Error when removing monitor profile {} from datastore", profileId, error);
                 result.set(RpcResultBuilder.<Void>failed().withError(ErrorType.APPLICATION, msg, error).build());
             }