From 5c0377f6970ca333680db50b6dd946d4c39b99c1 Mon Sep 17 00:00:00 2001 From: Mike Naquin Date: Thu, 25 Jul 2013 13:32:37 -0500 Subject: [PATCH] Add RemoteSyslogListener::LOG_PROP_APP and RemoteSyslogListener::LOG_PROP_HOST so that we can more easily access these special log message properties. --- Net/include/Poco/Net/RemoteSyslogListener.h | 3 +++ Net/src/RemoteSyslogListener.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Net/include/Poco/Net/RemoteSyslogListener.h b/Net/include/Poco/Net/RemoteSyslogListener.h index 2a2e03f0e..18fcf3ae6 100644 --- a/Net/include/Poco/Net/RemoteSyslogListener.h +++ b/Net/include/Poco/Net/RemoteSyslogListener.h @@ -118,6 +118,9 @@ public: static const std::string PROP_PORT; static const std::string PROP_THREADS; + static const std::string LOG_PROP_APP; + static const std::string LOG_PROP_HOST; + protected: ~RemoteSyslogListener(); /// Destroys the RemoteSyslogListener. diff --git a/Net/src/RemoteSyslogListener.cpp b/Net/src/RemoteSyslogListener.cpp index 9880eec29..4f3c37756 100644 --- a/Net/src/RemoteSyslogListener.cpp +++ b/Net/src/RemoteSyslogListener.cpp @@ -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),