So I’m trying to use boost.log with the syslog sink on my FreeBSD servers, which run rsyslogd and listen on a file socket for UDP data. Apparently this works in FreeBSD land. Indeed the file socket is a dgram socket (telnet to a file socket is another thing which works in FreeBSD):
$ telnet /var/run/log
Trying /var/run/log...
/var/run/log: Protocol wrong type for socket
At any rate, boost.log will not communicate with a file socket, only with an IP address. My plan is to proxy information between a regular IP-based UDP server which my application relays to the file socket. In theory, this should work fine.
However, I cannot find any way to get ASIO to communicate over UDP with a file socket, or even a file socket at all. I understand there may be ways of working with file I/O using ASIO, but this seems to be a hard Google search – nothing relevant comes up. Only a few things (on this very site) which have to deal with Windows file I/O and ASIO, at best.
Ideally, I’d be looking for something like this (though this doesn’t exist at all):
socket.send_to(boost::asio::buffer(data, length),
boost::asio::ip::udp::endpoint(boost::asio::ip::file_address("/var/run/log"), port);
But I’ll take anything that’ll work.
You’re looking for
local::datagram_protocol::endpointandlocal::datagram_protocol::socket.