diff --git a/global.json b/global.json index a2b2a415..0ac230bf 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "projects": [ "src", "test" ], "sdk": { - "version": "1.0.0-preview2-003121" + "version": "1.0.0-preview2-003131" } } diff --git a/src/Serilog.Sinks.Http/LoggerSinkConfigurationExtensions.cs b/src/Serilog.Sinks.Http/LoggerSinkConfigurationExtensions.cs index 3e3c8652..d59cd099 100644 --- a/src/Serilog.Sinks.Http/LoggerSinkConfigurationExtensions.cs +++ b/src/Serilog.Sinks.Http/LoggerSinkConfigurationExtensions.cs @@ -42,19 +42,24 @@ public static class LoggerSinkConfigurationExtensions /// The minimum level for events passed through the sink. The default is /// . /// - /// Logger configuration, allowing configuration to continue. + /// + /// A custom implementation. + /// + /// Logger configuration, allowing configuration to continue. public static LoggerConfiguration Http( this LoggerSinkConfiguration sinkConfiguration, string requestUri, int? batchPostingLimit = null, TimeSpan? period = null, IFormatProvider formatProvider = null, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) + LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, + IHttpClient httpClient = null) { if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration)); - var client = new HttpClientWrapper(); + var client = httpClient ?? new HttpClientWrapper(); + var sink = new HttpSink( client, requestUri,