Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uri scheme must be tcp or tls #27

Open
stianl opened this issue Nov 14, 2019 · 1 comment
Open

Uri scheme must be tcp or tls #27

stianl opened this issue Nov 14, 2019 · 1 comment

Comments

@stianl
Copy link

stianl commented Nov 14, 2019

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?

@pauldambra
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants