Serilog.Sinks.Network
Serilog.Sinks.Network copied to clipboard
Uri scheme must be tcp or tls
According to the documentation configuring the Sink using a hostname and port should be valid:
var urlLogger = new LoggerConfiguration()
.WriteTo.TCPSink("some.url.com", 1337)
.CreateLogger();
Howerver, when I attempt this I get the following exception:
An unhandled exception of type 'System.UriFormatException' occurred in Serilog.Sinks.Network.dll: 'Uri scheme must be tcp or tls' at Serilog.Sinks.Network.NetworkLoggerConfigurationExtensions.BuildUri(String s) at Serilog.Sinks.Network.NetworkLoggerConfigurationExtensions.TCPSink(LoggerSinkConfiguration loggerConfiguration, String uri, ITextFormatter textFormatter, LogEventLevel restrictedToMinimumLevel)
Is this an error in the documentation, or a bug?
I appreciate this comment is very late :)
That does look like a failure of documentation.
TCP sink only has two constructors. One that takes an IP address, and one that takes a URI
Presumably, that documentation should reference "tcp://some.url.com". But should write a test to confirm that!