Skip to content

v6.0.0

Compare
Choose a tag to compare
@mishamyte mishamyte released this 02 Jun 13:27
· 153 commits to master since this release
f01dbae

Implemented:

Breaking changes:

  • Deprecated dependency Serilog.Sinks.Http
  • Replaced IHttpClient with ILokiHttpClient
    Migration guide:
    You will have to migrate your code if you've implemented your own version of ILokiHttpClient. The signature of method ILokiHttpClient.PostAsync (before upgrade IHttpClient.PostAsync has changed from Task PostAsync(string, HttpContent) to Task PostAsync(string, Stream).

Before upgrade:

public class CustomLokiHttpClient : IHttpClient
{
  // Code removed for brevity...

  public async Task<HttpResponseMessage> PostAsync(string requestUri, HttpContent content)
  {
    // Here you probably have some code updating the content,
    // and then you send the request
    return await httpClient.PostAsync(requestUri, content)
  }
}

After update:

public class CustomLokiHttpClient : ILokiHttpClient
{
  // Code removed for brevity...

  public async Task<HttpResponseMessage> PostAsync(string requestUri, Stream contentStream)
  {
      using var content = new StreamContent(contentStream);

      // Here you probably have some code updating the content,
      // and then you send the request
      return await httpClient.PostAsync(requestUri, content)
  }
}