Update syslog_sink.h

Syslog already adds formatting, such as the identifier set with `openlog` in the constructor, the priority, and timestamp -- using the formatted message duplicates this information in the log message. This especially causes problems when the syslog is forwarded to aggregators such as Loggly, Logstash, etc. which can parse log messages which are JSON. However, the duplicated fields which spdlog prepends interfere with this -- better to use `raw` in the syslog case I think, or perhaps add an ability to use custom formatters on individual sinks.
This commit is contained in:
Chris Hiszpanski 2015-10-21 11:49:35 -07:00
parent f56e712cde
commit 08f41d4f65

View File

@ -75,7 +75,7 @@ public:
void log(const details::log_msg &msg) override
{
::syslog(syslog_prio_from_level(msg), "%s", msg.formatted.str().c_str());
::syslog(syslog_prio_from_level(msg), "%s", msg.raw.str().c_str());
}
void flush() override