From: Scott Cantor Date: Mon, 15 Nov 2010 22:04:36 +0000 (+0000) Subject: https://issues.shibboleth.net/jira/browse/CPPOST-57 X-Git-Tag: 2.4~8 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=commitdiff_plain;h=ed2e3f7b3d3c350b4d893b9f9e5f5b38cf8588ff https://issues.shibboleth.net/jira/browse/CPPOST-57 --- 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 {