Add RemoteSyslogListener::LOG_PROP_APP and RemoteSyslogListener::LOG_PROP_HOST so that we can more easily access these special log message properties.

This commit is contained in:
Mike Naquin
2013-07-25 13:32:37 -05:00
parent fd6433eb4e
commit 5c0377f697
2 changed files with 8 additions and 2 deletions

View File

@@ -323,8 +323,8 @@ void SyslogParser::parseNew(const std::string& line, RemoteSyslogChannel::Severi
int tzd = 0;
bool hasDate = Poco::DateTimeParser::tryParse(RemoteSyslogChannel::SYSLOG_TIMEFORMAT, timeStr, date, tzd);
Poco::Message logEntry(msgId, messageText, prio);
logEntry["host"] = hostName;
logEntry["app"] = appName;
logEntry[RemoteSyslogListener::LOG_PROP_HOST] = hostName;
logEntry[RemoteSyslogListener::LOG_PROP_APP] = appName;
if (hasDate)
logEntry.setTime(date.timestamp());
@@ -448,6 +448,9 @@ Poco::Message::Priority SyslogParser::convert(RemoteSyslogChannel::Severity seve
const std::string RemoteSyslogListener::PROP_PORT("port");
const std::string RemoteSyslogListener::PROP_THREADS("threads");
const std::string RemoteSyslogListener::LOG_PROP_APP("app");
const std::string RemoteSyslogListener::LOG_PROP_HOST("host");
RemoteSyslogListener::RemoteSyslogListener():
_pListener(0),