Skip to content

Releases: FantasticFiasco/serilog-sinks-http

Release v8.0.0-beta.6

07 May 20:42
Compare
Choose a tag to compare
Release v8.0.0-beta.6 Pre-release
Pre-release

💉 Fixed

  • #190 Add data flushing from GzipStream to underlying stream (contribution by @AntonSmolkov)

Release v8.0.0-beta.5

04 May 20:26
Compare
Choose a tag to compare
Release v8.0.0-beta.5 Pre-release
Pre-release

💫 Changed

Migration guide

You will have to migrate your code if you're using DurableHttpUsingTimeRolledBuffers, i.e. use the durable HTTP sink with a rolling behavior defined by a time interval. The parameter bufferPathFormat has been renamed to bufferBaseFileName, and the parameter bufferRollingInterval has been added.

Given you are configuring the sink in code you should do the following changes.

// Before migration
log = new LoggerConfiguration()
  .WriteTo.DurableHttpUsingTimeRolledBuffers(
    requestUri: "https://www.mylogs.com",
    bufferPathFormat: "MyBuffer-{Hour}.json")
  .CreateLogger();

// After migration
log = new LoggerConfiguration()
  .WriteTo.DurableHttpUsingTimeRolledBuffers(
    requestUri: "https://www.mylogs.com",
    bufferBaseFileName: "MyBuffer",
    bufferRollingInterval: BufferRollingInterval.Hour)
  .CreateLogger();

Given you are configuring the sink in application configuration you should do the following changes.

// Before migration
{
  "Serilog": {
    "WriteTo": [
      {
        "Name": "DurableHttpUsingTimeRolledBuffers",
        "Args": {
          "requestUri": "https://www.mylogs.com",
          "bufferPathFormat": "MyBuffer-{Hour}.json"
        }
      }
    ]
  }
}

// After migration
{
  "Serilog": {
    "WriteTo": [
      {
        "Name": "DurableHttpUsingTimeRolledBuffers",
        "Args": {
          "requestUri": "https://www.mylogs.com",
          "bufferBaseFileName": "MyBuffer",
          "bufferRollingInterval": "Hour"
        }
      }
    ]
  }
}

Release v8.0.0-beta.4

29 Apr 21:24
Compare
Choose a tag to compare
Release v8.0.0-beta.4 Pre-release
Pre-release

💉 Fixed

Release v8.0.0-beta.3

29 Apr 20:32
Compare
Choose a tag to compare
Release v8.0.0-beta.3 Pre-release
Pre-release

⚡ Added

💫 Changed

  • #166 [BREAKING CHANGE] Interface IHttpClient has changed to accommodate for different HTTP content types

Migration guide

You will have to migrate your code if you've implemented your own version of IHttpClient. The signature of method IHttpClient.PostAsync has changed from Task<HttpResponseMessage> PostAsync(string, HttpContent) to Task<HttpResponseMessage> PostAsync(string, Stream).

// Before migration
public class MyHttpClient : 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 migration
public class MyHttpClient : IHttpClient
{
  // Code removed for brevity...

  public async Task<HttpResponseMessage> PostAsync(string requestUri, Stream contentStream)
  {
    using (var content = new StreamContent(contentStream))
    {
      content.Headers.Add("Content-Type", "application/json");

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

Release v8.0.0-beta.2

15 Mar 06:11
Compare
Choose a tag to compare
Release v8.0.0-beta.2 Pre-release
Pre-release

💉 Fixed

  • Durable buffer files are no longer created with an initial BOM

Release v8.0.0-beta.1

08 Mar 23:04
Compare
Choose a tag to compare
Release v8.0.0-beta.1 Pre-release
Pre-release

⚡ Added

  • #116 [BREAKING CHANGE] Support specifying batchSizeLimitBytes when creating the sink, thus limiting the size of the payloads sent to the log server (proposed by @michaeltdaniels)

Migration guide

By far the easiest way to migrate your code is to stop using positional arguments and instead use named arguments.

If you use the non-durable sink please make the following changes to your code.

// Before migration
log = new LoggerConfiguration()
  .WriteTo.Http("https://www.mylogs.com", 500, 500)
  .CreateLogger();

// After migration
log = new LoggerConfiguration()
  .WriteTo.Http(
    requestUri: "https://www.mylogs.com",
    batchPostingLimit: 500,
    // the new argument batchSizeLimitBytes is positioned here
    queueLimit: 500)
  .CreateLogger();

If you use the durable file size rolled sink please make the following changes to your code.

// Before migration
log = new LoggerConfiguration()
  .WriteTo.DurableHttpUsingFileSizeRolledBuffers(
      "https://www.mylogs.com",
      "MyBuffer",
      ByteSize.GB,
      false,
      10,
      500,
      TimeSpan.FromSeconds(10))
  .CreateLogger();

// After migration
log = new LoggerConfiguration()
  .WriteTo.DurableHttpUsingFileSizeRolledBuffers(
      requestUri: "https://www.mylogs.com",
      bufferBaseFileName: "MyBuffer",
      bufferFileSizeLimitBytes: ByteSize.GB,
      bufferFileShared: false,
      retainedBufferFileCountLimit: 10,
      batchPostingLimit: 500,
      // the new argument batchSizeLimitBytes is positioned here
      period: TimeSpan.FromSeconds(10))
  .CreateLogger();

If you use the durable time rolled sink please make the following changes to your code.

// Before migration
log = new LoggerConfiguration()
  .WriteTo.DurableHttpUsingTimeRolledBuffers(
      "https://www.mylogs.com",
      "MyBuffer-{Date}.json",
      ByteSize.GB,
      false,
      10,
      500,
      TimeSpan.FromSeconds(10))
  .CreateLogger();

// After migration
log = new LoggerConfiguration()
  .WriteTo.DurableHttpUsingTimeRolledBuffers(
      requestUri: "https://www.mylogs.com",
      bufferPathFormat: "MyBuffer-{Date}.json",
      bufferFileSizeLimitBytes: ByteSize.GB,
      bufferFileShared: false,
      retainedBufferFileCountLimit: 10,
      batchPostingLimit: 500,
      // the new argument batchSizeLimitBytes is positioned here
      period: TimeSpan.FromSeconds(10))
  .CreateLogger();

Release v7.2.0

19 Oct 21:22
Compare
Choose a tag to compare

⚡ Added

Release v7.1.0

18 Oct 20:09
Compare
Choose a tag to compare

⚡ Added

  • Add class ByteSize which helps specifying multipliers of the unit byte.

💉 Fixed

  • #135 The type IConfiguration exists in both Microsoft.Extensions.Configuration.Abstractions and Serilog.Sinks.Http (discovered by @brian-pickens-web and contributed by @aleksaradz)

Release v7.0.1

14 Aug 21:06
Compare
Choose a tag to compare

💉 Fixed

  • #127 NuGet package does not show an icon
  • Configure SourceLink to embed untracked sources
  • Configure SourceLink to use deterministic builds when running on AppVeyor

Release v7.0.0

12 Aug 21:33
Compare
Choose a tag to compare

⚡ Added