#include <xmltooling/util/Threads.h>
#include <xmltooling/validation/ValidatorSuite.h>
+#if defined(OPENSAML_LOG4SHIB)
+# include <log4shib/NDC.hh>
+#elif defined(OPENSAML_LOG4CPP)
+# include <log4cpp/NDC.hh>
+#endif
+
using namespace opensaml::saml2md;
using namespace xmltooling::logging;
using namespace xmltooling;
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 {
pair<bool,DOMElement*> XMLMetadataProvider::load(bool backup)
{
- // Lower the refresh rate in case of an error.
- m_reloadInterval = m_minRefreshDelay;
+ if (!backup) {
+ // Lower the refresh rate in case of an error.
+ m_reloadInterval = m_minRefreshDelay;
+ }
// Call the base class to load/parse the appropriate XML resource.
pair<bool,DOMElement*> raw = ReloadableXMLFile::load(backup);
// Tracking cacheUntil through the tree is TBD, but
// validUntil is the tightest interval amongst the children.
- // If a remote resource, adjust the reload interval.
- if (!backup && !m_local) {
+ // If a remote resource that's monitored, adjust the reload interval.
+ if (!backup && !m_local && m_lock) {
m_backoffFactor = 1;
m_reloadInterval = computeNextRefresh();
m_log.info("adjusted reload interval to %d seconds", m_reloadInterval);