Skip to content

Commit

Permalink
Merge pull request #28 from anaselhajjaji/master
Browse files Browse the repository at this point in the history
Make the class LokiHttpClient abstract to be used in appsettings.json
  • Loading branch information
josephwoodward authored Nov 10, 2020
2 parents 88860a5 + 2b780a8 commit 89319f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/Serilog.Sinks.Loki/DefaultLokiHttpClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Serilog.Sinks.Loki
{
public class DefaultLokiHttpClient : LokiHttpClient
{
}
}
2 changes: 1 addition & 1 deletion src/Serilog.Sinks.Loki/LokiHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Serilog.Sinks.Loki
{
public class LokiHttpClient : IHttpClient
public abstract class LokiHttpClient : IHttpClient
{
protected readonly HttpClient HttpClient;

Expand Down
2 changes: 1 addition & 1 deletion src/Serilog.Sinks.Loki/LokiSinkExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ private static LoggerConfiguration LokiHttpImpl(this LoggerSinkConfiguration sin
{
var formatter = logLabelProvider != null ? new LokiBatchFormatter(logLabelProvider.GetLabels()) : new LokiBatchFormatter();

var client = httpClient ?? new LokiHttpClient();
var client = httpClient ?? new DefaultLokiHttpClient();
if (client is LokiHttpClient c)
{
c.SetAuthCredentials(credentials);
Expand Down

0 comments on commit 89319f2

Please sign in to comment.