Merge pull request #257 from syvex/feature/RemoteSyslogListenerAppAndHost

Add RemoteSyslogListener::LOG_PROP_APP and RemoteSyslogListener::LOG_PRO...
This commit is contained in:
Günter Obiltschnig 2013-09-13 07:43:14 -07:00
commit 148b7c26fb
2 changed files with 8 additions and 2 deletions

View File

@ -118,6 +118,9 @@ public:
static const std::string PROP_PORT; static const std::string PROP_PORT;
static const std::string PROP_THREADS; static const std::string PROP_THREADS;
static const std::string LOG_PROP_APP;
static const std::string LOG_PROP_HOST;
protected: protected:
~RemoteSyslogListener(); ~RemoteSyslogListener();
/// Destroys the RemoteSyslogListener. /// Destroys the RemoteSyslogListener.

View File

@ -323,8 +323,8 @@ void SyslogParser::parseNew(const std::string& line, RemoteSyslogChannel::Severi
int tzd = 0; int tzd = 0;
bool hasDate = Poco::DateTimeParser::tryParse(RemoteSyslogChannel::SYSLOG_TIMEFORMAT, timeStr, date, tzd); bool hasDate = Poco::DateTimeParser::tryParse(RemoteSyslogChannel::SYSLOG_TIMEFORMAT, timeStr, date, tzd);
Poco::Message logEntry(msgId, messageText, prio); Poco::Message logEntry(msgId, messageText, prio);
logEntry["host"] = hostName; logEntry[RemoteSyslogListener::LOG_PROP_HOST] = hostName;
logEntry["app"] = appName; logEntry[RemoteSyslogListener::LOG_PROP_APP] = appName;
if (hasDate) if (hasDate)
logEntry.setTime(date.timestamp()); 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_PORT("port");
const std::string RemoteSyslogListener::PROP_THREADS("threads"); 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(): RemoteSyslogListener::RemoteSyslogListener():
_pListener(0), _pListener(0),