From 6620183579be1eeffd8d07a5dc094c49c8379195 Mon Sep 17 00:00:00 2001 From: "Charles E. Rolke" Date: Fri, 13 Jul 2012 15:08:56 +0000 Subject: QPID-4079 log entries track managed object life cycles git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1361262 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/ConnectionHandler.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'cpp/src/qpid/broker/ConnectionHandler.cpp') diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp index 4af4692f78..06f442a47f 100644 --- a/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -152,12 +152,20 @@ void ConnectionHandler::Handler::startOk(const ConnectionStartOkBody& body) authenticator->start(body.getMechanism(), body.hasResponse() ? &body.getResponse() : 0); } catch (std::exception& /*e*/) { management::ManagementAgent* agent = connection.getAgent(); - if (agent) { + bool logEnabled; + QPID_LOG_TEST_CAT(debug, model, logEnabled); + if (logEnabled || agent) + { string error; string uid; authenticator->getError(error); authenticator->getUid(uid); - agent->raiseEvent(_qmf::EventClientConnectFail(connection.getMgmtId(), uid, error)); + if (agent) { + agent->raiseEvent(_qmf::EventClientConnectFail(connection.getMgmtId(), uid, error)); + } + QPID_LOG_CAT(debug, model, "Failed connection. rhost:" << connection.getMgmtId() + << " user:" << uid + << " reason:" << error ); } throw; } @@ -200,12 +208,20 @@ void ConnectionHandler::Handler::secureOk(const string& response) authenticator->step(response); } catch (std::exception& /*e*/) { management::ManagementAgent* agent = connection.getAgent(); - if (agent) { + bool logEnabled; + QPID_LOG_TEST_CAT(debug, model, logEnabled); + if (logEnabled || agent) + { string error; string uid; authenticator->getError(error); authenticator->getUid(uid); - agent->raiseEvent(_qmf::EventClientConnectFail(connection.getMgmtId(), uid, error)); + if (agent) { + agent->raiseEvent(_qmf::EventClientConnectFail(connection.getMgmtId(), uid, error)); + } + QPID_LOG_CAT(debug, model, "Failed connection. rhost:" << connection.getMgmtId() + << " user:" << uid + << " reason:" << error ); } throw; } @@ -283,7 +299,7 @@ void ConnectionHandler::Handler::start(const FieldTable& serverProperties, service, host, 0, // TODO -- mgoulish Fri Sep 24 2010 - 256, + 256, false ); // disallow interaction } std::string supportedMechanismsList; -- cgit v1.2.1