
16 Feb
2009
16 Feb
'09
5:54 p.m.
Darryl Green wrote:
I started trying to hack about the syslog sink to directly generate and send an RFC3164 message. I'm not quite sure how one should use the formatters and/or how to do a suitably general mapping of attributes to RFC3164 message fields. I need to do something like this:
ostringstream ss; ss << "<" facility * 8 + level << ">" << fmt::date_time< types
("DateTime", fmt::keywords::format = "%b %d %H:%M:%S")) << " " << host_name << " " << program_name << ": " << formatted_message; std::string s = ss.str(); send(sock, s.c_str(), s.size());
Suggestions?
I think, the RFC3164 packet structure should not be achieved with formatters, at least not those exposed to the user. The protocol is the sink's implementation detail.