Change log message identifier for components/*.

Refs #6346
This commit is contained in:
Michael Friedrich 2014-05-28 13:03:44 +02:00
parent 33cf660c04
commit 0f9d76d40b
17 changed files with 65 additions and 65 deletions

View 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)

View 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"] + "'");
{

View 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);
}

View 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());
}
}

View 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));
}

View 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())));
}
}

View 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))));
}
}

View 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;
}

View 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;

View 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));
}

View 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);

View 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(':');

View 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);

View 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);

View 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);
}
}
}

View 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();
}

View 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)