]> granicus.if.org Git - icinga2/commitdiff
Change log message identifier for components/*.
authorMichael Friedrich <michael.friedrich@netways.de>
Wed, 28 May 2014 11:03:44 +0000 (13:03 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 28 May 2014 12:42:00 +0000 (14:42 +0200)
Refs #6346

17 files changed:
components/checker/checkercomponent.cpp
components/compat/checkresultreader.cpp
components/compat/compatlogger.cpp
components/compat/externalcommandlistener.cpp
components/compat/statusdatawriter.cpp
components/db_ido_mysql/idomysqlconnection.cpp
components/db_ido_pgsql/idopgsqlconnection.cpp
components/demo/demo.cpp
components/livestatus/attributefilter.cpp
components/livestatus/listener.cpp
components/livestatus/logtable.cpp
components/livestatus/logutility.cpp
components/livestatus/query.cpp
components/livestatus/statehisttable.cpp
components/notification/notificationcomponent.cpp
components/perfdata/graphitewriter.cpp
components/perfdata/perfdatawriter.cpp

index fb8b7092658e21f044f73def26e67be265b9c4ae..abb4ac9739a5823ac65de04162bea80879999cc4 100644 (file)
@@ -86,7 +86,7 @@ void CheckerComponent::Start(void)
 
 void CheckerComponent::Stop(void)
 {
-       Log(LogInformation, "checker", "Checker stopped.");
+       Log(LogInformation, "CheckerComponent", "Checker stopped.");
 
        {
                boost::mutex::scoped_lock lock(m_Mutex);
@@ -135,7 +135,7 @@ void CheckerComponent::CheckThreadProc(void)
 
                if (!forced) {
                        if (!checkable->IsReachable(DependencyCheckExecution)) {
-                               Log(LogNotice, "icinga", "Skipping check for object '" + checkable->GetName() + "': Dependency failed.");
+                               Log(LogNotice, "CheckerComponent", "Skipping check for object '" + checkable->GetName() + "': Dependency failed.");
                                check = false;
                        }
 
@@ -144,18 +144,18 @@ void CheckerComponent::CheckThreadProc(void)
                        tie(host, service) = GetHostService(checkable);
 
                        if (host && !service && (!checkable->GetEnableActiveChecks() || !IcingaApplication::GetInstance()->GetEnableHostChecks())) {
-                               Log(LogNotice, "checker", "Skipping check for host '" + host->GetName() + "': active host checks are disabled");
+                               Log(LogNotice, "CheckerComponent", "Skipping check for host '" + host->GetName() + "': active host checks are disabled");
                                check = false;
                        }
                        if (host && service && (!checkable->GetEnableActiveChecks() || !IcingaApplication::GetInstance()->GetEnableServiceChecks())) {
-                               Log(LogNotice, "checker", "Skipping check for service '" + service->GetName() + "': active service checks are disabled");
+                               Log(LogNotice, "CheckerComponent", "Skipping check for service '" + service->GetName() + "': active service checks are disabled");
                                check = false;
                        }
 
                        TimePeriod::Ptr tp = checkable->GetCheckPeriod();
 
                        if (tp && !tp->IsInside(Utility::GetTime())) {
-                               Log(LogNotice, "checker", "Skipping check for object '" + checkable->GetName() + "': not in check_period");
+                               Log(LogNotice, "CheckerComponent", "Skipping check for object '" + checkable->GetName() + "': not in check_period");
                                check = false;
                        }
                }
@@ -181,7 +181,7 @@ void CheckerComponent::CheckThreadProc(void)
                        checkable->SetForceNextCheck(false);
                }
 
-               Log(LogDebug, "checker", "Executing check for '" + checkable->GetName() + "'");
+               Log(LogDebug, "CheckerComponent", "Executing check for '" + checkable->GetName() + "'");
 
                CheckerComponent::Ptr self = GetSelf();
                Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, self, checkable));
@@ -230,7 +230,7 @@ void CheckerComponent::ExecuteCheckHelper(const Checkable::Ptr& checkable)
                }
        }
 
-       Log(LogDebug, "checker", "Check finished for object '" + checkable->GetName() + "'");
+       Log(LogDebug, "CheckerComponent", "Check finished for object '" + checkable->GetName() + "'");
 }
 
 void CheckerComponent::ResultTimerHandler(void)
@@ -244,7 +244,7 @@ void CheckerComponent::ResultTimerHandler(void)
                    << (CIB::GetActiveHostChecksStatistics(5) + CIB::GetActiveServiceChecksStatistics(5)) / 5.0;
        }
 
-       Log(LogNotice, "checker", msgbuf.str());
+       Log(LogNotice, "CheckerComponent", msgbuf.str());
 }
 
 void CheckerComponent::ObjectHandler(const DynamicObject::Ptr& object)
index 095b9b8dcaac7b791fd74918dfde86a6c88ef92b..d9d9a198d768c97b41203c7474c5bd7dd72a2705 100644 (file)
@@ -118,7 +118,7 @@ void CheckResultReader::ProcessCheckResultFile(const String& path) const
        Host::Ptr host = Host::GetByName(attrs["host_name"]);
 
        if (!host) {
-               Log(LogWarning, "compat", "Ignoring checkresult file for host '" + attrs["host_name"] +
+               Log(LogWarning, "CheckResultReader", "Ignoring checkresult file for host '" + attrs["host_name"] +
                    "': Host does not exist.");
 
                return;
@@ -127,7 +127,7 @@ void CheckResultReader::ProcessCheckResultFile(const String& path) const
        Service::Ptr service = host->GetServiceByShortName(attrs["service_description"]);
 
        if (!service) {
-               Log(LogWarning, "compat", "Ignoring checkresult file for host '" + attrs["host_name"] +
+               Log(LogWarning, "CheckResultReader", "Ignoring checkresult file for host '" + attrs["host_name"] +
                    "', service '" + attrs["service_description"] + "': Service does not exist.");
 
                return;
@@ -143,7 +143,7 @@ void CheckResultReader::ProcessCheckResultFile(const String& path) const
 
        service->ProcessCheckResult(result);
 
-       Log(LogDebug, "compat", "Processed checkresult file for host '" + attrs["host_name"] +
+       Log(LogDebug, "CheckResultReader", "Processed checkresult file for host '" + attrs["host_name"] +
                    "', service '" + attrs["service_description"] + "'");
 
        {
index d610af96e3a5201c6d5cc335d6c502714e03d8fe..de9ef756468cb3629dc2c02a1df323ad9f0a8f49 100644 (file)
@@ -321,7 +321,7 @@ void CompatLogger::FlappingHandler(const Checkable::Ptr& checkable, FlappingStat
                        flapping_state_str = "DISABLED";
                        break;
                default:
-                       Log(LogCritical, "compat", "Unknown flapping state: " + Convert::ToString(flapping_state));
+                       Log(LogCritical, "CompatLogger", "Unknown flapping state: " + Convert::ToString(flapping_state));
                        return;
        }
 
@@ -434,7 +434,7 @@ void CompatLogger::ReopenFile(bool rotate)
                if (rotate) {
                        String archiveFile = GetLogDir() + "/archives/icinga-" + Utility::FormatDateTime("%m-%d-%Y-%H", Utility::GetTime()) + ".log";
 
-                       Log(LogNotice, "compat", "Rotating compat log file '" + tempFile + "' -> '" + archiveFile + "'");
+                       Log(LogNotice, "CompatLogger", "Rotating compat log file '" + tempFile + "' -> '" + archiveFile + "'");
                        (void) rename(tempFile.CStr(), archiveFile.CStr());
                }
        }
@@ -442,7 +442,7 @@ void CompatLogger::ReopenFile(bool rotate)
        m_OutputFile.open(tempFile.CStr(), std::ofstream::app);
 
        if (!m_OutputFile.good()) {
-               Log(LogWarning, "icinga", "Could not open compat log file '" + tempFile + "' for writing. Log output will be lost.");
+               Log(LogWarning, "CompatLogger", "Could not open compat log file '" + tempFile + "' for writing. Log output will be lost.");
 
                return;
        }
@@ -536,7 +536,7 @@ void CompatLogger::ScheduleNextRotation(void)
 
        time_t ts = mktime(&tmthen);
 
-       Log(LogNotice, "compat", "Rescheduling rotation timer for compat log '"
+       Log(LogNotice, "CompatLogger", "Rescheduling rotation timer for compat log '"
            + GetName() + "' to '" + Utility::FormatDateTime("%Y/%m/%d %H:%M:%S %z", ts) + "'");
        m_RotationTimer->Reschedule(ts);
 }
index 8308281b16af3a84b72e34d5ae6d4f1263b3f573..eb9deb85a1b2242114947a518293aae05bb295d1 100644 (file)
@@ -130,13 +130,13 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
                        String command = line;
 
                        try {
-                               Log(LogInformation, "compat", "Executing external command: " + command);
+                               Log(LogInformation, "ExternalCommandListener", "Executing external command: " + command);
 
                                ExternalCommandProcessor::Execute(command);
                        } catch (const std::exception& ex) {
                                std::ostringstream msgbuf;
                                msgbuf << "External command failed: " << DiagnosticInformation(ex);
-                               Log(LogWarning, "compat", msgbuf.str());
+                               Log(LogWarning, "ExternalCommandListener", msgbuf.str());
                        }
                }
 
index e23842344fcf7d5a4725db0086ee6723410afc7e..5e968787230d1bca9fbd2f1b07867e8b98f93366 100644 (file)
@@ -693,7 +693,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
                Checkable::Ptr parent = dep->GetParent();
 
                if (!parent) {
-                       Log(LogDebug, "compat", "Missing parent for dependency '" + dep->GetName() + "'.");
+                       Log(LogDebug, "StatusDataWriter", "Missing parent for dependency '" + dep->GetName() + "'.");
                        continue;
                }
 
@@ -705,7 +705,7 @@ void StatusDataWriter::UpdateObjectsCache(void)
 
                if (!child) {
                        continue;
-                       Log(LogDebug, "compat", "Missing child for dependency '" + dep->GetName() + "'.");
+                       Log(LogDebug, "StatusDataWriter", "Missing child for dependency '" + dep->GetName() + "'.");
                }
 
                Host::Ptr child_host;
@@ -840,5 +840,5 @@ void StatusDataWriter::StatusTimerHandler(void)
                    << boost::errinfo_file_name(statuspathtmp));
        }
 
-       Log(LogNotice, "compat", "Writing status.dat file took " + Utility::FormatDuration(Utility::GetTime() - start));
+       Log(LogNotice, "StatusDataWriter", "Writing status.dat file took " + Utility::FormatDuration(Utility::GetTime() - start));
 }
index bc5443a346c00dedb065c07f48b16e1f13b80952..7bacf3f53db2c87f30371e204cdb75bfe5ec5c59 100644 (file)
@@ -94,7 +94,7 @@ void IdoMysqlConnection::Pause(void)
 
 void IdoMysqlConnection::ExceptionHandler(boost::exception_ptr exp)
 {
-       Log(LogWarning, "db_ido_mysql", "Exception during database operation: " + DiagnosticInformation(exp));
+       Log(LogWarning, "IdoMysqlConnection", "Exception during database operation: " + DiagnosticInformation(exp));
 
        boost::mutex::scoped_lock lock(m_ConnectionMutex);
 
@@ -228,7 +228,7 @@ void IdoMysqlConnection::Reconnect(void)
 
                std::ostringstream msgbuf;
                msgbuf << "MySQL IDO instance id: " << static_cast<long>(m_InstanceID) << " (schema version: '" + version + "')";
-               Log(LogInformation, "db_ido_mysql", msgbuf.str());
+               Log(LogInformation, "IdoMysqlConnection", msgbuf.str());
 
                /* set session time zone to utc */
                Query("SET SESSION TIME_ZONE='+00:00'");
@@ -268,7 +268,7 @@ void IdoMysqlConnection::Reconnect(void)
        /* deactivate all deleted configuration objects */
        BOOST_FOREACH(const DbObject::Ptr& dbobj, active_dbobjs) {
                if (dbobj->GetObject() == NULL) {
-                       Log(LogNotice, "db_ido", "Deactivate deleted object name1: '" + Convert::ToString(dbobj->GetName1() +
+                       Log(LogNotice, "IdoMysqlConnection", "Deactivate deleted object name1: '" + Convert::ToString(dbobj->GetName1() +
                            "' name2: '" + Convert::ToString(dbobj->GetName2() + "'.")));
                        DeactivateObject(dbobj);
                }
@@ -284,7 +284,7 @@ IdoMysqlResult IdoMysqlConnection::Query(const String& query)
 {
        AssertOnWorkQueue();
 
-       Log(LogDebug, "db_ido_mysql", "Query: " + query);
+       Log(LogDebug, "IdoMysqlConnection", "Query: " + query);
 
        if (mysql_query(&m_Connection, query.CStr()) != 0)
                BOOST_THROW_EXCEPTION(
@@ -619,7 +619,7 @@ void IdoMysqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType
 
        if (type == DbQueryInsert && query.Table == "notifications" && query.NotificationObject) { // FIXME remove hardcoded table name
                SetNotificationInsertID(query.NotificationObject, GetLastInsertID());
-               Log(LogDebug, "db_ido", "saving contactnotification notification_id=" + Convert::ToString(static_cast<long>(GetLastInsertID())));
+               Log(LogDebug, "IdoMysqlConnection", "saving contactnotification notification_id=" + Convert::ToString(static_cast<long>(GetLastInsertID())));
        }
 }
 
index fe192c67e0b2c7e8f3b8c42a83531969df2d6b02..d9fe92ad110c9d0ab585cd88724cf53cbe2144c3 100644 (file)
@@ -96,7 +96,7 @@ void IdoPgsqlConnection::Pause(void)
 
 void IdoPgsqlConnection::ExceptionHandler(boost::exception_ptr exp)
 {
-       Log(LogWarning, "db_ido_pgsql", "Exception during database operation: " + DiagnosticInformation(exp));
+       Log(LogWarning, "IdoPgsqlConnection", "Exception during database operation: " + DiagnosticInformation(exp));
 
        boost::mutex::scoped_lock lock(m_ConnectionMutex);
 
@@ -232,7 +232,7 @@ void IdoPgsqlConnection::Reconnect(void)
 
                std::ostringstream msgbuf;
                msgbuf << "pgSQL IDO instance id: " << static_cast<long>(m_InstanceID) << " (schema version: '" + version + "')";
-               Log(LogInformation, "db_ido_pgsql", msgbuf.str());
+               Log(LogInformation, "IdoPgsqlConnection", msgbuf.str());
 
                /* record connection */
                Query("INSERT INTO " + GetTablePrefix() + "conninfo " +
@@ -272,7 +272,7 @@ void IdoPgsqlConnection::Reconnect(void)
        /* deactivate all deleted configuration objects */
        BOOST_FOREACH(const DbObject::Ptr& dbobj, active_dbobjs) {
                if (dbobj->GetObject() == NULL) {
-                       Log(LogNotice, "db_ido", "Deactivate deleted object name1: '" + Convert::ToString(dbobj->GetName1() +
+                       Log(LogNotice, "IdoPgsqlConnection", "Deactivate deleted object name1: '" + Convert::ToString(dbobj->GetName1() +
                            "' name2: '" + Convert::ToString(dbobj->GetName2() + "'.")));
                        DeactivateObject(dbobj);
                }
@@ -288,7 +288,7 @@ IdoPgsqlResult IdoPgsqlConnection::Query(const String& query)
 {
        AssertOnWorkQueue();
 
-       Log(LogDebug, "db_ido_pgsql", "Query: " + query);
+       Log(LogDebug, "IdoPgsqlConnection", "Query: " + query);
 
        PGresult *result = PQexec(m_Connection, query.CStr());
 
@@ -330,7 +330,7 @@ DbReference IdoPgsqlConnection::GetSequenceValue(const String& table, const Stri
 
        std::ostringstream msgbuf;
        msgbuf << "Sequence Value: " << row->Get("id");
-       Log(LogDebug, "db_ido_pgsql", msgbuf.str());
+       Log(LogDebug, "IdoPgsqlConnection", msgbuf.str());
 
        return DbReference(Convert::ToLong(row->Get("id")));
 }
@@ -630,7 +630,7 @@ void IdoPgsqlConnection::InternalExecuteQuery(const DbQuery& query, DbQueryType
        if (type == DbQueryInsert && query.Table == "notifications" && query.NotificationObject) { // FIXME remove hardcoded table name
                String idField = "notification_id";
                SetNotificationInsertID(query.NotificationObject, GetSequenceValue(GetTablePrefix() + query.Table, idField));
-               Log(LogDebug, "db_ido", "saving contactnotification notification_id=" + Convert::ToString(static_cast<long>(GetSequenceValue(GetTablePrefix() + query.Table, idField))));
+               Log(LogDebug, "IdoPgsqlConnection", "saving contactnotification notification_id=" + Convert::ToString(static_cast<long>(GetSequenceValue(GetTablePrefix() + query.Table, idField))));
        }
 }
 
index d1f298624ceadb06d49d220077b733ed90602477..250302c57362f053ed1e68410f4bcf53930714b9 100644 (file)
@@ -53,13 +53,13 @@ void Demo::DemoTimerHandler(void)
        ApiListener::Ptr listener = ApiListener::GetInstance();
        if (listener) {
                listener->RelayMessage(MessageOrigin(), DynamicObject::Ptr(), message, true);
-               Log(LogInformation, "demo", "Sent demo::HelloWorld message");
+               Log(LogInformation, "Demo", "Sent demo::HelloWorld message");
        }
 }
 
 Value Demo::DemoMessageHandler(const MessageOrigin& origin, const Dictionary::Ptr&)
 {
-       Log(LogInformation, "demo", "Got demo message from '" + origin.FromClient->GetEndpoint()->GetName() + "'");
+       Log(LogInformation, "Demo", "Got demo message from '" + origin.FromClient->GetEndpoint()->GetName() + "'");
 
        return Empty;
 }
index 03ace091bd8cc5f3c8870b03a141784fe29fe48f..72aa8e2f02e68b85802583e29dedb51099750b3f 100644 (file)
@@ -65,7 +65,7 @@ bool AttributeFilter::Apply(const Table::Ptr& table, const Value& row)
                        boost::smatch what;
                        bool ret = boost::regex_search(operand.GetData(), what, expr);
 
-                       //Log(LogDebug, "livestatus", "Attribute filter '" + m_Operand + " " + m_Operator + " " +
+                       //Log(LogDebug, "LivestatusListener/AttributeFilter", "Attribute filter '" + m_Operand + " " + m_Operator + " " +
                        //    static_cast<String>(value) + "' " + (ret ? "matches" : "doesn't match") + "." );
 
                        return ret;
@@ -77,7 +77,7 @@ bool AttributeFilter::Apply(const Table::Ptr& table, const Value& row)
                        boost::smatch what;
                        bool ret = boost::regex_search(operand.GetData(), what, expr);
 
-                       //Log(LogDebug, "livestatus", "Attribute filter '" + m_Operand + " " + m_Operator + " " +
+                       //Log(LogDebug, "LivestatusListener/AttributeFilter", "Attribute filter '" + m_Operand + " " + m_Operator + " " +
                        //    static_cast<String>(value) + "' " + (ret ? "matches" : "doesn't match") + "." );
 
                        return ret;
index dfb8a1aed1a2f6941de6bd207785dd14fd4e674c..776462597580079013e9afe0b4507341a97af2dd 100644 (file)
@@ -74,7 +74,7 @@ void LivestatusListener::Start(void)
 
                boost::thread thread(boost::bind(&LivestatusListener::ServerThreadProc, this, socket));
                thread.detach();
-               Log(LogInformation, "livestatus", "Created tcp socket listening on host '" + GetBindHost() + "' port '" + GetBindPort() + "'.");
+               Log(LogInformation, "LivestatusListener", "Created tcp socket listening on host '" + GetBindHost() + "' port '" + GetBindPort() + "'.");
        }
        else if (GetSocketType() == "unix") {
 #ifndef _WIN32
@@ -93,10 +93,10 @@ void LivestatusListener::Start(void)
 
                boost::thread thread(boost::bind(&LivestatusListener::ServerThreadProc, this, socket));
                thread.detach();
-               Log(LogInformation, "livestatus", "Created unix socket in '" + GetSocketPath() + "'.");
+               Log(LogInformation, "LivestatusListener", "Created unix socket in '" + GetSocketPath() + "'.");
 #else
                /* no unix sockets on windows */
-               Log(LogCritical, "livestatus", "Unix sockets are not supported on Windows.");
+               Log(LogCritical, "LivestatusListener", "Unix sockets are not supported on Windows.");
                return;
 #endif
        }
@@ -123,7 +123,7 @@ void LivestatusListener::ServerThreadProc(const Socket::Ptr& server)
        for (;;) {
                Socket::Ptr client = server->Accept();
 
-               Log(LogNotice, "livestatus", "Client connected");
+               Log(LogNotice, "LivestatusListener", "Client connected");
 
                Utility::QueueAsyncCallback(boost::bind(&LivestatusListener::ClientHandler, this, client));
        }
index 179ad4e6d27ead7055f0516e79e0b2deae04453b..11138816bfa3d959a32a6704196536a6b8f77d76 100644 (file)
@@ -91,7 +91,7 @@ String LogTable::GetName(void) const
 
 void LogTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       Log(LogNotice, "livestatus", "Pre-selecting log file from " + Convert::ToString(m_TimeFrom) + " until " + Convert::ToString(m_TimeUntil));
+       Log(LogNotice, "LivestatusListener/LogTable", "Pre-selecting log file from " + Convert::ToString(m_TimeFrom) + " until " + Convert::ToString(m_TimeUntil));
 
        /* create log file index */
        LogUtility::CreateLogIndex(m_CompatLogPath, m_LogFileIndex);
index f8b1059239f643a4d675a6e3e7bafbf8a30e9a5b..032d5b93f77bed3871fad843391cb77cc94fe116 100644 (file)
@@ -68,7 +68,7 @@ void LogUtility::CreateLogIndexFileHandler(const String& path, std::map<time_t,
 
        stream.close();
 
-       Log(LogDebug, "livestatus", "Indexing log file: '" + path + "' with timestamp start: '" + Convert::ToString(ts_start) + "'.");
+       Log(LogDebug, "LivestatusListener/LogUtility", "Indexing log file: '" + path + "' with timestamp start: '" + Convert::ToString(ts_start) + "'.");
 
        index[ts_start] = path;
 }
@@ -104,7 +104,7 @@ void LogUtility::CreateLogCache(std::map<time_t, String> index, HistoryTable *ta
 
                        /* no attributes available - invalid log line */
                        if (!log_entry_attrs) {
-                               Log(LogDebug, "livestatus", "Skipping invalid log line: '" + line + "'.");
+                               Log(LogDebug, "LivestatusListener/LogUtility", "Skipping invalid log line: '" + line + "'.");
                                continue;
                        }
 
@@ -127,7 +127,7 @@ Dictionary::Ptr LogUtility::GetAttributes(const String& text)
          */
         unsigned long time = atoi(text.SubStr(1, 11).CStr());
 
-        Log(LogDebug, "livestatus", "Processing log line: '" + text + "'.");
+        Log(LogDebug, "LivestatusListener/LogUtility", "Processing log line: '" + text + "'.");
         bag->Set("time", time);
 
         size_t colon = text.FindFirstOf(':');
index d1aea90bb93271ffc8ca0dab0a779dc9cd7786d4..1584a96fa7902f02af9bc64cf30fcf273ae59688 100644 (file)
@@ -62,7 +62,7 @@ Query::Query(const std::vector<String>& lines, const String& compat_log_path)
        BOOST_FOREACH(const String& line, lines) {
                msg += line + "\n";
        }
-       Log(LogDebug, "livestatus", msg);
+       Log(LogDebug, "LivestatusListener/Query", msg);
 
        m_CompatLogPath = compat_log_path;
 
@@ -202,10 +202,10 @@ Query::Query(const std::vector<String>& lines, const String& compat_log_path)
 
                        if (header == "Or" || header == "StatsOr") {
                                filter = make_shared<OrFilter>();
-                               Log(LogDebug, "livestatus", "Add OR filter for " + params + " column(s). " + Convert::ToString(deq.size()) + " filters available.");
+                               Log(LogDebug, "LivestatusListener/Query", "Add OR filter for " + params + " column(s). " + Convert::ToString(deq.size()) + " filters available.");
                        } else {
                                filter = make_shared<AndFilter>();
-                               Log(LogDebug, "livestatus", "Add AND filter for " + params + " column(s). " + Convert::ToString(deq.size()) + " filters available.");
+                               Log(LogDebug, "LivestatusListener/Query", "Add AND filter for " + params + " column(s). " + Convert::ToString(deq.size()) + " filters available.");
                        }
 
                        if (num > deq.size()) {
@@ -217,7 +217,7 @@ Query::Query(const std::vector<String>& lines, const String& compat_log_path)
 
                        while (num > 0 && num--) {
                                filter->AddSubFilter(deq.back());
-                               Log(LogDebug, "livestatus", "Add " +  Convert::ToString(num) + " filter.");
+                               Log(LogDebug, "LivestatusListener/Query", "Add " +  Convert::ToString(num) + " filter.");
                                deq.pop_back();
                                if (&deq == &stats)
                                        aggregators.pop_back();
@@ -340,7 +340,7 @@ Filter::Ptr Query::ParseFilter(const String& params, unsigned long& from, unsign
                }
        }
 
-       Log(LogDebug, "livestatus", "Parsed filter with attr: '" + attr + "' op: '" + op + "' val: '" + val + "'.");
+       Log(LogDebug, "LivestatusListener/Query", "Parsed filter with attr: '" + attr + "' op: '" + op + "' val: '" + val + "'.");
 
        return filter;
 }
@@ -393,7 +393,7 @@ void Query::PrintCsvArray(std::ostream& fp, const Array::Ptr& array, int level)
 
 void Query::ExecuteGetHelper(const Stream::Ptr& stream)
 {
-       Log(LogInformation, "livestatus", "Table: " + m_Table);
+       Log(LogInformation, "LivestatusListener/Query", "Table: " + m_Table);
 
        Table::Ptr table = Table::GetByName(m_Table, m_CompatLogPath, m_LogTimeFrom, m_LogTimeUntil);
 
@@ -498,14 +498,14 @@ void Query::ExecuteCommandHelper(const Stream::Ptr& stream)
                l_ExternalCommands++;
        }
 
-       Log(LogInformation, "livestatus", "Executing command: " + m_Command);
+       Log(LogInformation, "LivestatusListener/Query", "Executing command: " + m_Command);
        ExternalCommandProcessor::Execute(m_Command);
        SendResponse(stream, LivestatusErrorOK, "");
 }
 
 void Query::ExecuteErrorHelper(const Stream::Ptr& stream)
 {
-       Log(LogDebug, "livestatus", "ERROR: Code: '" + Convert::ToString(m_ErrorCode) + "' Message: '" + m_ErrorMessage + "'.");
+       Log(LogDebug, "LivestatusListener/Query", "ERROR: Code: '" + Convert::ToString(m_ErrorCode) + "' Message: '" + m_ErrorMessage + "'.");
        SendResponse(stream, m_ErrorCode, m_ErrorMessage);
 }
 
@@ -521,7 +521,7 @@ void Query::SendResponse(const Stream::Ptr& stream, int code, const String& data
                        std::ostringstream info;
                        info << "Exception thrown while writing to the livestatus socket: " << std::endl
                             << DiagnosticInformation(ex);
-                       Log(LogCritical, "livestatus", info.str());
+                       Log(LogCritical, "LivestatusListener/Query", info.str());
                }
        }
 }
@@ -541,14 +541,14 @@ void Query::PrintFixed16(const Stream::Ptr& stream, int code, const String& data
                std::ostringstream info;
                info << "Exception thrown while writing to the livestatus socket: " << std::endl
                     << DiagnosticInformation(ex);
-               Log(LogCritical, "livestatus", info.str());
+               Log(LogCritical, "LivestatusListener/Query", info.str());
        }
 }
 
 bool Query::Execute(const Stream::Ptr& stream)
 {
        try {
-               Log(LogInformation, "livestatus", "Executing livestatus query: " + m_Verb);
+               Log(LogInformation, "LivestatusListener/Query", "Executing livestatus query: " + m_Verb);
 
                if (m_Verb == "GET")
                        ExecuteGetHelper(stream);
index 6efe76ddef70e0a364667804bcbbda2f97618ccb..350ea93aa4d924d80ce2426cb73418d18a185a37 100644 (file)
@@ -117,7 +117,7 @@ void StateHistTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, in
 
                state_hist_service_states->Add(state_hist_bag);
 
-               Log(LogDebug, "livestatus", "statehist: Adding new object '" + checkable->GetName() + "' to services cache.");
+               Log(LogDebug, "LivestatusListener/StateHistTable", "statehist: Adding new object '" + checkable->GetName() + "' to services cache.");
        } else {
                state_hist_service_states = m_CheckablesCache[checkable];
                state_hist_bag = state_hist_service_states->Get(state_hist_service_states->GetLength()-1); /* fetch latest state from history */
@@ -173,7 +173,7 @@ void StateHistTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, in
 
                                        state_hist_service_states->Add(state_hist_bag_new);
 
-                                       Log(LogDebug, "livestatus", "statehist: State change detected for object '" +
+                                       Log(LogDebug, "LivestatusListener/StateHistTable", "statehist: State change detected for object '" +
                                            checkable->GetName() + "' in '" + log_line + "'.");
                                }
                                break;
@@ -252,7 +252,7 @@ String StateHistTable::GetName(void) const
 
 void StateHistTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       Log(LogNotice, "livestatus", "Pre-selecting log file from " + Convert::ToString(m_TimeFrom) + " until " + Convert::ToString(m_TimeUntil));
+       Log(LogNotice, "LivestatusListener/StateHistTable", "Pre-selecting log file from " + Convert::ToString(m_TimeFrom) + " until " + Convert::ToString(m_TimeUntil));
 
        /* create log file index */
        LogUtility::CreateLogIndex(m_CompatLogPath, m_LogFileIndex);
index 90a12b8cbe7a63be09e8a4d02b739e88632417c0..cec7cc4d070725f77fac6bbcaab9551d14e6996c 100644 (file)
@@ -105,7 +105,7 @@ void NotificationComponent::NotificationTimerHandler(void)
                }
 
                try {
-                       Log(LogInformation, "notification", "Sending reminder notification for object '" + checkable->GetName() + "'");
+                       Log(LogInformation, "NotificationComponent", "Sending reminder notification for object '" + checkable->GetName() + "'");
                        notification->BeginExecuteNotification(NotificationProblem, checkable->GetLastCheckResult(), false);
                } catch (const std::exception& ex) {
                        std::ostringstream msgbuf;
@@ -113,7 +113,7 @@ void NotificationComponent::NotificationTimerHandler(void)
                               << GetName() << "': " << DiagnosticInformation(ex);
                        String message = msgbuf.str();
 
-                       Log(LogWarning, "icinga", message);
+                       Log(LogWarning, "NotificationComponent", message);
                }
        }
 }
index 22250bfbf264ab4c9697ce7bd4bd42a65429dc1a..5472ad982a92b8b20ac1f43786e5e93eb21907db 100644 (file)
@@ -77,16 +77,16 @@ void GraphiteWriter::ReconnectTimerHandler(void)
        try {
                if (m_Stream) {
                        m_Stream->Write("\n", 1);
-                       Log(LogNotice, "perfdata", "GraphiteWriter already connected on socket on host '" + GetHost() + "' port '" + GetPort() + "'.");
+                       Log(LogNotice, "GraphiteWriter", "GraphiteWriter already connected on socket on host '" + GetHost() + "' port '" + GetPort() + "'.");
                        return;
                }
        } catch (const std::exception& ex) {
-               Log(LogWarning, "perfdata", "GraphiteWriter socket on host '" + GetHost() + "' port '" + GetPort() + "' gone. Attempting to reconnect.");
+               Log(LogWarning, "GraphiteWriter", "GraphiteWriter socket on host '" + GetHost() + "' port '" + GetPort() + "' gone. Attempting to reconnect.");
        }
 
        TcpSocket::Ptr socket = make_shared<TcpSocket>();
 
-       Log(LogNotice, "perfdata", "GraphiteWriter: Reconnect to tcp socket on host '" + GetHost() + "' port '" + GetPort() + "'.");
+       Log(LogNotice, "GraphiteWriter", "GraphiteWriter: Reconnect to tcp socket on host '" + GetHost() + "' port '" + GetPort() + "'.");
        socket->Connect(GetHost(), GetPort());
 
        m_Stream = make_shared<NetworkStream>(socket);
@@ -163,7 +163,7 @@ void GraphiteWriter::SendMetric(const String& prefix, const String& name, double
        msgbuf << prefix << "." << name << " " << value << " " << static_cast<long>(Utility::GetTime()) << "\n";
 
        String metric = msgbuf.str();
-       Log(LogDebug, "perfdata", "GraphiteWriter: Add to metric list:'" + metric + "'.");
+       Log(LogDebug, "GraphiteWriter", "GraphiteWriter: Add to metric list:'" + metric + "'.");
 
        ObjectLock olock(this);
 
@@ -177,7 +177,7 @@ void GraphiteWriter::SendMetric(const String& prefix, const String& name, double
                msgbuf << "Exception thrown while writing to the Graphite socket: " << std::endl
                       << DiagnosticInformation(ex);
 
-               Log(LogCritical, "perfdata", msgbuf.str());
+               Log(LogCritical, "GraphiteWriter", msgbuf.str());
 
                m_Stream.reset();
        }
index 9da2707aebe4b2d7a9166e1c3d353d143b6d3848..ea256e2c105d5f870d0b08acddc9c349ff451430 100644 (file)
@@ -122,7 +122,7 @@ void PerfdataWriter::RotateFile(std::ofstream& output, const String& temp_path,
        output.open(temp_path.CStr());
 
        if (!output.good())
-               Log(LogWarning, "icinga", "Could not open perfdata file '" + temp_path + "' for writing. Perfdata will be lost.");
+               Log(LogWarning, "PerfdataWriter", "Could not open perfdata file '" + temp_path + "' for writing. Perfdata will be lost.");
 }
 
 void PerfdataWriter::RotationTimerHandler(void)