borisermakof / serilog-sinks-fluentd

A Sink that writes logs into Fluentd
Apache License 2.0
20 stars 30 forks source link

Unix sockets support #7

Closed igprya closed 4 years ago

igprya commented 6 years ago

Introduces an ability to send logs into Fluentd through Unix domain socket file. The README was updated with short usage instructions.

A user can now specify a path to the socket file as a parameter for Fluentd sink: ...WriteTo.Fluentd("/var/run/fluentd/fluentd.sock").CreateLogger();

On the inside, an IEndpoint interface has been introduced along with two concrete classes that implement it:

The FluentdSinkClient has been updated to deal with an IEndpoint object instead of concrete client implementation. The type of an endpoint is determined and a concrete object is created at InitializeEndpoint() function (former InitializeTcpClient()).

Note: due to the fact that current version .NET Core lacks Unix socket support, Unix.Endpoint class from Mono.Posix had to be employed, thankfully its license allows such usage.

Alessar commented 6 years ago

LGTM too. So we are waiting merge and new version.