mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 18:45:10 +01:00
Merge pull request #257 from syvex/feature/RemoteSyslogListenerAppAndHost
Add RemoteSyslogListener::LOG_PROP_APP and RemoteSyslogListener::LOG_PRO...
This commit is contained in:
commit
148b7c26fb
@ -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.
|
||||||
|
@ -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),
|
||||||
|
Loading…
Reference in New Issue
Block a user