From a7f406e41c52253d3e9e5cbdfed10ce77ba7c8be Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20de=20Talhou=C3=ABt?= Date: Fri, 21 Oct 2016 16:37:48 -0400 Subject: [PATCH] Add the RemoteDeviceId at the begining of the log MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit So it's easier to grep and find things related to one netconf connector, and also, to keep things consistent with how it's already done in sal-netconf-connector Change-Id: I29ee41c699de8287fd6e00f3a04cacb3d17c5fd1 Signed-off-by: Alexis de Talhouët (cherry picked from commit 518b77c6c392a18270297705634dd5bff260ea29) --- .../singleton/impl/MasterSalFacade.java | 4 ++-- .../singleton/impl/NetconfNodeManager.java | 12 +++++----- .../impl/NetconfTopologyManager.java | 4 ++-- .../impl/RemoteDeviceConnectorImpl.java | 22 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java index 7fa8e5aaad..8e45cbc374 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java @@ -131,7 +131,7 @@ class MasterSalFacade implements AutoCloseable, RemoteDeviceHandler(LogicalDatastoreType.OPERATIONAL, NetconfTopologyUtils.createTopologyNodeListPath(key, topologyId)), this); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java index 6cad5c1c04..cfd9dd8113 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java @@ -176,14 +176,14 @@ public class NetconfTopologyManager try { netconfTopologyContext.closeFinal(); } catch (Exception e) { - LOG.warn("Error at closing topology context. InstanceIdentifier: " + instanceIdentifier); + LOG.error("Error at closing topology context. InstanceIdentifier: " + instanceIdentifier, e); } }); clusterRegistrations.forEach((instanceIdentifier, clusterSingletonServiceRegistration) -> { try { clusterSingletonServiceRegistration.close(); } catch (Exception e) { - LOG.warn("Error at unregistering from cluster. InstanceIdentifier: " + instanceIdentifier); + LOG.error("Error at unregistering from cluster. InstanceIdentifier: " + instanceIdentifier, e); } }); contexts.clear(); diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java index 47405b87c8..0525789d15 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/RemoteDeviceConnectorImpl.java @@ -137,23 +137,23 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { Futures.addCallback(future, new FutureCallback() { @Override public void onSuccess(NetconfDeviceCapabilities result) { - LOG.debug("{}: Connector started succesfully", nodeId.getValue()); + LOG.debug("{}: Connector started successfully", remoteDeviceId); } @Override public void onFailure(@Nullable Throwable throwable) { - LOG.error("{}: Connector failed, {}", nodeId.getValue(), throwable); + LOG.error("{}: Connector failed, {}", remoteDeviceId, throwable); } }); } @Override public void stopRemoteDeviceConnection() { - Preconditions.checkNotNull(deviceCommunicatorDTO, "Device communicator was not created."); + Preconditions.checkNotNull(deviceCommunicatorDTO, remoteDeviceId + ": Device communicator was not created."); try { deviceCommunicatorDTO.close(); } catch (Exception e) { - LOG.warn("{}: Error at closing device communicator.", remoteDeviceId); + LOG.error("{}: Error at closing device communicator.", remoteDeviceId, e); } } @@ -172,7 +172,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { netconfTopologyDeviceSetup.getDomBroker(), netconfTopologyDeviceSetup.getBindingAwareBroker(), netconfTopologyDeviceSetup.getActorSystem(), deviceContextActorRef); if (keepaliveDelay > 0) { - LOG.info("Device: {} , Adding keepalive facade.", nodeId); + LOG.info("{}: Adding keepalive facade.", remoteDeviceId); salFacade = new KeepaliveSalFacade(remoteDeviceId, salFacade, netconfTopologyDeviceSetup.getKeepaliveExecutor().getExecutor(), keepaliveDelay, defaultRequestTimeoutMillis); @@ -226,7 +226,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { ? NetconfTopologyUtils.DEFAULT_CONCURRENT_RPC_LIMIT : node.getConcurrentRpcLimit(); if (rpcMessageLimit < 1) { - LOG.info("Device: {}, Concurrent rpc limit is smaller than 1, no limit will be enforced.", remoteDeviceId); + LOG.info("{}: Concurrent rpc limit is smaller than 1, no limit will be enforced.", remoteDeviceId); } return new NetconfConnectorDTO( @@ -249,8 +249,8 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { final NetconfSessionPreferences parsedOverrideCapabilities = NetconfSessionPreferences.fromStrings(capabilities); - Preconditions.checkState(parsedOverrideCapabilities.getNonModuleCaps().isEmpty(), - "Capabilities to override can only contain module based capabilities, non-module capabilities " + Preconditions.checkState(parsedOverrideCapabilities.getNonModuleCaps().isEmpty(), remoteDeviceId + + ": Capabilities to override can only contain module based capabilities, non-module capabilities " + "will be retrieved from the device, configured non-module capabilities: " + parsedOverrideCapabilities.getNonModuleCaps()); @@ -283,11 +283,11 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { } } LOG.info("{} : netconf connector will use schema cache directory {} instead of {}", - nodeId.getValue(), moduleSchemaCacheDirectory, NetconfTopologyUtils.DEFAULT_CACHE_DIRECTORY); + remoteDeviceId, moduleSchemaCacheDirectory, NetconfTopologyUtils.DEFAULT_CACHE_DIRECTORY); } } else { LOG.info("{} : using the default directory {}", - nodeId.getValue(), NetconfTopologyUtils.QUALIFIED_DEFAULT_CACHE_DIRECTORY); + remoteDeviceId, NetconfTopologyUtils.QUALIFIED_DEFAULT_CACHE_DIRECTORY); } if (schemaResourcesDTO == null) { @@ -402,7 +402,7 @@ public class RemoteDeviceConnectorImpl implements RemoteDeviceConnector { ((org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPassword) credentials).getUsername(), ((org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPassword) credentials).getPassword()); } else { - throw new IllegalStateException("Only login/password authentification is supported"); + throw new IllegalStateException(remoteDeviceId + ": Only login/password authentication is supported"); } return NetconfReconnectingClientConfigurationBuilder.create() -- 2.36.6