Improved logging in PCEP. 33/6933/3
authorDana Kutenicsova <dkutenic@cisco.com>
Tue, 13 May 2014 14:17:23 +0000 (16:17 +0200)
committerDana Kutenicsova <dkutenic@cisco.com>
Wed, 14 May 2014 11:38:53 +0000 (13:38 +0200)
Change-Id: I65fc9ff9ab7409317e2cb43033534ad643efb051
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/AbstractPCEPSessionNegotiator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java

index 72c6fcc657e713f6565d13efb2083423978466bf..1555b725ce720b266ac9f80e726749f8d6235697 100644 (file)
@@ -193,7 +193,7 @@ public abstract class AbstractPCEPSessionNegotiator extends AbstractSessionNegot
                this.state = State.OpenWait;
                scheduleFailTimer();
 
-               LOG.debug("Channel {} started sent proposal {}", this.channel, this.localPrefs);
+               LOG.info("PCEP session with {} started, sent proposal {}", this.channel, this.localPrefs);
        }
 
        @Override
@@ -210,7 +210,7 @@ public abstract class AbstractPCEPSessionNegotiator extends AbstractSessionNegot
                        if (msg instanceof Keepalive) {
                                this.localOK = true;
                                if (this.remoteOK) {
-                                       LOG.info("Channel {} completed negotiation", this.channel);
+                                       LOG.info("PCEP peer {} completed negotiation", this.channel);
                                        negotiationSuccessful(createSession(this.timer, this.channel, this.localPrefs, this.remotePrefs));
                                        this.state = State.Finished;
                                } else {
@@ -255,6 +255,7 @@ public abstract class AbstractPCEPSessionNegotiator extends AbstractSessionNegot
                                        this.remoteOK = true;
                                        if (this.localOK) {
                                                negotiationSuccessful(createSession(this.timer, this.channel, this.localPrefs, this.remotePrefs));
+                                               LOG.info("PCEP peer {} completed negotiation", this.channel);
                                                this.state = State.Finished;
                                        } else {
                                                scheduleFailTimer();
index 07d49152d0399a353c049cde18a4b7f68c25e289..dbbf0aab28891a3b173c13f97f24e921d2099c9b 100644 (file)
@@ -197,7 +197,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
                final ChannelFuture f = this.channel.writeAndFlush(msg);
                this.lastMessageSentAt = System.nanoTime();
                if (!(msg instanceof KeepaliveMessage)) {
-                       LOG.debug("Message enqueued: {}", msg);
+                       LOG.debug("PCEP Message enqueued: {}", msg);
                }
                this.sentMsgCount++;
 
@@ -205,7 +205,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
                        @Override
                        public void operationComplete(final ChannelFuture arg) {
                                if (arg.isSuccess()) {
-                                       LOG.debug("Message sent to socket: {}", msg);
+                                       LOG.trace("Message sent to socket: {}", msg);
                                } else {
                                        LOG.debug("Message not sent: {}", msg, arg.cause());
                                }
@@ -220,7 +220,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
         */
        @Override
        public void close() {
-               LOG.trace("Closing session: {}", this);
+               LOG.info("Closing PCEP session: {}", this);
                this.channel.close();
        }
 
@@ -231,7 +231,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
         */
        @Override
        public synchronized void close(final TerminationReason reason) {
-               LOG.debug("Closing session: {}", this);
+               LOG.info("Closing PCEP session: {}", this);
                this.closed = true;
                this.sendMessage(new CloseBuilder().setCCloseMessage(
                                new CCloseMessageBuilder().setCClose(new CCloseBuilder().setReason(reason.getShortValue()).build()).build()).build());
@@ -249,7 +249,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
        }
 
        private synchronized void terminate(final TerminationReason reason) {
-               LOG.info("Local session termination : {}", reason);
+               LOG.info("Local PCEP session termination : {}", reason);
                this.listener.onSessionTerminated(this, new PCEPCloseTermination(reason));
                this.closed = true;
                this.sendMessage(new CloseBuilder().setCCloseMessage(
@@ -313,11 +313,12 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
                // Update last reception time
                this.lastMessageReceivedAt = System.nanoTime();
                this.receivedMsgCount++;
-
+               if (!(msg instanceof KeepaliveMessage)) {
+                       LOG.debug("PCEP message {} received.", msg);
+               }
                // Internal message handling. The user does not see these messages
                if (msg instanceof KeepaliveMessage) {
                        // Do nothing, the timer has been already reset
-                       LOG.trace("Session {} received a keepalive", this);
                } else if (msg instanceof OpenMessage) {
                        this.sendErrorMessage(PCEPErrors.ATTEMPT_2ND_SESSION);
                } else if (msg instanceof CloseMessage) {