From ed2e3f7b3d3c350b4d893b9f9e5f5b38cf8588ff Mon Sep 17 00:00:00 2001 From: Scott Cantor Date: Mon, 15 Nov 2010 22:04:36 +0000 Subject: [PATCH] https://issues.shibboleth.net/jira/browse/CPPOST-57 --- saml/saml2/metadata/impl/XMLMetadataProvider.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/saml/saml2/metadata/impl/XMLMetadataProvider.cpp b/saml/saml2/metadata/impl/XMLMetadataProvider.cpp index 961cff6..57bb4cf 100644 --- a/saml/saml2/metadata/impl/XMLMetadataProvider.cpp +++ b/saml/saml2/metadata/impl/XMLMetadataProvider.cpp @@ -36,6 +36,12 @@ #include #include +#if defined(OPENSAML_LOG4SHIB) +# include +#elif defined(OPENSAML_LOG4CPP) +# include +#endif + using namespace opensaml::saml2md; using namespace xmltooling::logging; using namespace xmltooling; @@ -62,13 +68,25 @@ namespace opensaml { void init() { try { + if (!m_id.empty()) { + string threadid("["); + threadid += m_id + ']'; + logging::NDC::push(threadid); + } background_load(); startup(); } catch (...) { startup(); + if (!m_id.empty()) { + logging::NDC::pop(); + } throw; } + + if (!m_id.empty()) { + logging::NDC::pop(); + } } const XMLObject* getMetadata() const { -- 2.1.4