From 3feebb89a8ca07f93a256dd2e79b36416aa4e97d Mon Sep 17 00:00:00 2001
From: Jaime Perez Crespo <jaime.perez@uninett.no>
Date: Wed, 13 Apr 2016 13:07:38 +0200
Subject: [PATCH] When exceptions happen in the context of a SAML transaction,
 we don't need to log the sspmod_saml_Error exception itself, as that doesn't
 have any valuable information. We log the exception itself instead. Reword
 the previous message a bit, too.

---
 modules/saml/lib/IdP/SAML2.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index f85706bd9..7af8d842c 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -107,8 +107,8 @@ class sspmod_saml_IdP_SAML2 {
 
 		$error = sspmod_saml_Error::fromException($exception);
 
-		SimpleSAML\Logger::warning('Returning error to sp: ' . var_export($spEntityId, TRUE));
-		$error->logWarning();
+		SimpleSAML\Logger::warning("Returning error to SP with entity ID '".var_export($spEntityId, TRUE)."'.");
+		$exception->log(SimpleSAML\Logger::WARNING);
 
 		$ar = self::buildResponse($idpMetadata, $spMetadata, $consumerURL);
 		$ar->setInResponseTo($requestId);
-- 
GitLab