Skip to content

Commit 5c0377f

Browse files
author
Mike Naquin
committed
Add RemoteSyslogListener::LOG_PROP_APP and RemoteSyslogListener::LOG_PROP_HOST so that we can more easily access these special log message properties.
1 parent fd6433e commit 5c0377f

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Net/include/Poco/Net/RemoteSyslogListener.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ class Net_API RemoteSyslogListener: public Poco::SplitterChannel
118118
static const std::string PROP_PORT;
119119
static const std::string PROP_THREADS;
120120

121+
static const std::string LOG_PROP_APP;
122+
static const std::string LOG_PROP_HOST;
123+
121124
protected:
122125
~RemoteSyslogListener();
123126
/// Destroys the RemoteSyslogListener.

Net/src/RemoteSyslogListener.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ void SyslogParser::parseNew(const std::string& line, RemoteSyslogChannel::Severi
323323
int tzd = 0;
324324
bool hasDate = Poco::DateTimeParser::tryParse(RemoteSyslogChannel::SYSLOG_TIMEFORMAT, timeStr, date, tzd);
325325
Poco::Message logEntry(msgId, messageText, prio);
326-
logEntry["host"] = hostName;
327-
logEntry["app"] = appName;
326+
logEntry[RemoteSyslogListener::LOG_PROP_HOST] = hostName;
327+
logEntry[RemoteSyslogListener::LOG_PROP_APP] = appName;
328328

329329
if (hasDate)
330330
logEntry.setTime(date.timestamp());
@@ -448,6 +448,9 @@ Poco::Message::Priority SyslogParser::convert(RemoteSyslogChannel::Severity seve
448448
const std::string RemoteSyslogListener::PROP_PORT("port");
449449
const std::string RemoteSyslogListener::PROP_THREADS("threads");
450450

451+
const std::string RemoteSyslogListener::LOG_PROP_APP("app");
452+
const std::string RemoteSyslogListener::LOG_PROP_HOST("host");
453+
451454

452455
RemoteSyslogListener::RemoteSyslogListener():
453456
_pListener(0),

0 commit comments

Comments
 (0)