]> granicus.if.org Git - icinga2/commitdiff
Fix race condition in icinga::Log.
authorGunnar Beutner <gunnar@beutner.name>
Sun, 15 Dec 2013 17:15:05 +0000 (18:15 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Sun, 15 Dec 2013 17:46:09 +0000 (18:46 +0100)
Refs #5337

lib/base/logger.cpp

index 710c54211a2009be22adeeb6ce4957a198d6b1d2..5ad98aa283e95a9aa2e73b7d867e118792b200b3 100644 (file)
@@ -88,12 +88,12 @@ void icinga::Log(LogSeverity severity, const String& facility,
        bool processed = false;
 
        BOOST_FOREACH(const Logger::Ptr& logger, Logger::GetLoggers()) {
-               if (!logger->IsActive())
-                       continue;
-
                {
                        ObjectLock llock(logger);
 
+                       if (!logger->IsActive())
+                               continue;
+
                        if (entry.Severity >= logger->GetMinSeverity())
                                logger->ProcessLogEntry(entry);
                }