]> granicus.if.org Git - icinga2/commitdiff
Enable cluster debugging.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 17 Sep 2013 12:21:45 +0000 (14:21 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 17 Sep 2013 12:21:45 +0000 (14:21 +0200)
components/cluster/clustercomponent.cpp
components/cluster/jsonrpc.cpp

index 415283ea339f4f1d49cf464b5f947f7e5b138595..613d467bf767ed793ce306613999cf90555ee260 100644 (file)
@@ -249,9 +249,8 @@ void ClusterComponent::RelayMessage(const Endpoint::Ptr& source, const Dictionar
                if (source)
                        pmessage->Set("source", source->GetName());
 
-               pmessage->Set("security", message->Get("security"));
-
                pmessage->Set("message", Value(message).Serialize());
+               pmessage->Set("security", message->Get("security"));
 
                ObjectLock olock(this);
                if (m_LogFile) {
@@ -303,7 +302,7 @@ void ClusterComponent::RelayMessage(const Endpoint::Ptr& source, const Dictionar
                        continue;
 
                if (secobj && !secobj->HasPrivileges(endpoint->GetName(), privs)) {
-                       Log(LogDebug, "cluster", "Not sending message to endpoint '" + endpoint->GetName() + "': Insufficient privileges.");
+                       Log(LogWarning, "cluster", "Not sending message to endpoint '" + endpoint->GetName() + "': Insufficient privileges.");
                        continue;
                }
 
@@ -463,7 +462,7 @@ void ClusterComponent::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Pt
                                }
 
                                if (secobj && !secobj->HasPrivileges(endpoint->GetName(), privs)) {
-                                       Log(LogDebug, "cluster", "Not replaying message: Insufficient privileges.");
+                                       Log(LogWarning, "cluster", "Not replaying message: Insufficient privileges.");
                                        continue;
                                }
 
index a785cd65c5412aafd03c903930a10a6b6ae17e4f..edd84d01b50aa210ff73984b5f85bd9d16832893 100644 (file)
@@ -34,7 +34,7 @@ using namespace icinga;
 void JsonRpc::SendMessage(const Stream::Ptr& stream, const Dictionary::Ptr& message)
 {
        String json = Value(message).Serialize();
-//     std::cerr << ">> " << json << std::endl;
+       std::cerr << ">> " << json << std::endl;
        NetString::WriteStringToStream(stream, json);
 }
 
@@ -44,7 +44,7 @@ Dictionary::Ptr JsonRpc::ReadMessage(const Stream::Ptr& stream)
        if (!NetString::ReadStringFromStream(stream, &jsonString))
                BOOST_THROW_EXCEPTION(std::runtime_error("ReadStringFromStream signalled EOF."));
 
-//     std::cerr << "<< " << jsonString << std::endl;
+       std::cerr << "<< " << jsonString << std::endl;
        Value value = Value::Deserialize(jsonString);
 
        if (!value.IsObjectType<Dictionary>()) {