Add linefeeds to log, add logging of additional inbound messages. 2.0-beta2
authorScott Cantor <cantor.2@osu.edu>
Tue, 20 Nov 2007 22:57:31 +0000 (22:57 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 20 Nov 2007 22:57:31 +0000 (22:57 +0000)
saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp
saml/saml1/binding/impl/SAML1POSTEncoder.cpp
saml/saml1/binding/impl/SAML1SOAPDecoder.cpp
saml/saml1/binding/impl/SAML1SOAPEncoder.cpp
saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp
saml/saml2/binding/impl/SAML2ECPDecoder.cpp
saml/saml2/binding/impl/SAML2ECPEncoder.cpp
saml/saml2/binding/impl/SAML2POSTEncoder.cpp
saml/saml2/binding/impl/SAML2RedirectEncoder.cpp
saml/saml2/binding/impl/SAML2SOAPDecoder.cpp
saml/saml2/binding/impl/SAML2SOAPEncoder.cpp

index 672aeeb..f8797b8 100644 (file)
@@ -112,7 +112,7 @@ long SAML1ArtifactEncoder::encode(
         throw BindingException("SAML 1.x Artifact Encoder requires an ArtifactGenerator instance.");
     
     if (log.isDebugEnabled())
-        log.debugStream() << "marshalled assertion: " << *xmlObject << logging::eol;
+        log.debugStream() << "marshalled assertion:" << logging::eol << *xmlObject << logging::eol;
     
     auto_ptr_char recipientID(recipient ? recipient->getEntityID() : NULL);
     log.debug("obtaining new artifact for relying party (%s)", recipientID.get() ? recipientID.get() : "unknown");
index df0ee43..f7c8ecd 100644 (file)
@@ -150,7 +150,7 @@ long SAML1POSTEncoder::encode(
     TemplateEngine::TemplateParameters pmap;
     string& xmlbuf = pmap.m_map["SAMLResponse"];
     XMLHelper::serialize(rootElement, xmlbuf);
-    log.debug("marshalled response: %s", xmlbuf.c_str());
+    log.debug("marshalled response:\n%s", xmlbuf.c_str());
     
     // Replace with base-64 encoded version.
     unsigned int len=0;
index 971d700..d60dced 100644 (file)
@@ -84,6 +84,7 @@ XMLObject* SAML1SOAPDecoder::decode(
     const char* data = genericRequest.getRequestBody();
     if (!data)
         throw BindingException("SOAP message had an empty request body.");
+    log.debug("received message:\n%s", data);
     istringstream is(data);
     
     // Parse and bind the document into an XMLObject.
index bb9f984..f20e49d 100644 (file)
@@ -158,7 +158,7 @@ long SAML1SOAPEncoder::encode(
             s << *rootElement;
             
             if (log.isDebugEnabled())
-                log.debug("marshalled envelope: %s", s.str().c_str());
+                log.debug("marshalled envelope:\n%s", s.str().c_str());
             
             log.debug("sending serialized envelope");
             bool error = (!response && env->getBody() && env->getBody()->hasChildren() &&
@@ -196,7 +196,7 @@ long SAML1SOAPEncoder::encode(
             s << *rootElement;
             
             if (log.isDebugEnabled())
-                log.debug("marshalled envelope: %s", s.str().c_str());
+                log.debug("marshalled envelope:\n%s", s.str().c_str());
             
             log.debug("sending serialized envelope");
             long ret = genericResponse.sendError(s);
index e4a9cd3..f0f590c 100644 (file)
@@ -164,7 +164,7 @@ long SAML2ArtifactEncoder::encode(
     }
 
     if (log.isDebugEnabled())
-        log.debugStream() << "marshalled message: " << *xmlObject << logging::eol;
+        log.debugStream() << "marshalled message:" << logging::eol << *xmlObject << logging::eol;
     
     // Store the message. Last step in storage will be to delete the XML.
     log.debug("storing artifact and content in map");
index e867a5a..d311286 100644 (file)
@@ -85,6 +85,7 @@ XMLObject* SAML2ECPDecoder::decode(
     const char* data = genericRequest.getRequestBody();
     if (!data)
         throw BindingException("PAOS message had an empty request body.");
+    log.debug("received message:\n%s", data);
     istringstream is(data);
     
     // Parse and bind the document into an XMLObject.
index 7a1f1ad..2cddf29 100644 (file)
@@ -225,7 +225,7 @@ long SAML2ECPEncoder::encode(
         s << *rootElement;
         
         if (log.isDebugEnabled())
-            log.debug("marshalled envelope: %s", s.str().c_str());
+            log.debug("marshalled envelope:\n%s", s.str().c_str());
 
         log.debug("sending serialized envelope");
         long ret = genericResponse.sendResponse(s);
index bc651c2..3b303fc 100644 (file)
@@ -158,7 +158,7 @@ long SAML2POSTEncoder::encode(
     TemplateEngine::TemplateParameters pmap;
     string& msg = pmap.m_map[(request ? "SAMLRequest" : "SAMLResponse")];
     XMLHelper::serialize(rootElement, msg);
-    log.debug("marshalled message: %s", msg.c_str());
+    log.debug("marshalled message:\n%s", msg.c_str());
     
     // SimpleSign.
     if (credential && m_simple) {
index ac711f1..e4222fa 100644 (file)
@@ -116,7 +116,7 @@ long SAML2RedirectEncoder::encode(
     DOMElement* rootElement = xmlObject->marshall();
     string xmlbuf;
     XMLHelper::serialize(rootElement, xmlbuf);
-    log.debug("marshalled message: %s", xmlbuf.c_str());
+    log.debug("marshalled message:\n%s", xmlbuf.c_str());
     
     unsigned int len;
     char* deflated = deflate(const_cast<char*>(xmlbuf.c_str()), xmlbuf.length(), &len);
index 8325d33..e006a9e 100644 (file)
@@ -84,6 +84,7 @@ XMLObject* SAML2SOAPDecoder::decode(
     const char* data = genericRequest.getRequestBody();
     if (!data)
         throw BindingException("SOAP message had an empty request body.");
+    log.debug("received message:\n%s", data);
     istringstream is(data);
     
     // Parse and bind the document into an XMLObject.
index 98f5e9b..3efb12b 100644 (file)
@@ -156,7 +156,7 @@ long SAML2SOAPEncoder::encode(
             s << *rootElement;
             
             if (log.isDebugEnabled())
-                log.debug("marshalled envelope: %s", s.str().c_str());
+                log.debug("marshalled envelope:\n%s", s.str().c_str());
 
             log.debug("sending serialized envelope");
             bool error = (!msg && env->getBody() && env->getBody()->hasChildren() &&
@@ -194,7 +194,7 @@ long SAML2SOAPEncoder::encode(
             s << *rootElement;
             
             if (log.isDebugEnabled())
-                log.debug("marshalled envelope: %s", s.str().c_str());
+                log.debug("marshalled envelope:\n%s", s.str().c_str());
 
             log.debug("sending serialized envelope");
             long ret = genericResponse.sendError(s);