Skip to content

Latest commit

Β 

History

History
625 lines (448 loc) Β· 26.3 KB

CHANGELOG.md

File metadata and controls

625 lines (448 loc) Β· 26.3 KB

Change Log

All notable changes to this project will be documented in this file.

This project adheres to Semantic Versioning and is following the change log format.

Unreleased

[9.0.0] - 2024-04-14

⚑ Added

  • #311 [BREAKING CHANGE] Support specifying levelSwitch when creating the sink, thus adding the support to dynamically change the log level at runtime (contribution by @yuriy-millen)

    Migration guide

    The parameter levelSwitch has been introduced to the methods Http, DurableHttpUsingFileSizeRolledBuffers and DurableHttpUsingTimeRolledBuffers. Please verify that the arguments pass by you to these methods still align with your intentions.

    To automatically mitigate this kind of new parameter issue in the future, move from using positional arguments to named arguments.

  • #262 [BREAKING CHANGE] Support specifying flushOnClose when creating the sink, thus adding the support to suppress sending unsent log events to the log server before closing the sink (proposed by @murlidakhare, @julichan, @janichirag11 & @prasadpaul53)

    Migration guide

    The parameter flushOnClose has been introduced to the methods Http, DurableHttpUsingFileSizeRolledBuffers and DurableHttpUsingTimeRolledBuffers. Please verify that the arguments pass by you to these methods still align with your intentions.

    To automatically mitigate this kind of new parameter issue in the future, move from using positional arguments to named arguments.

  • Support for .NET Framework 4.6.2

πŸ’« Changed

  • #262 [BREAKING CHANGE] A new argument of type CancellationToken has been added to the PostAsync method of interface IHttpClient.

πŸ’€ Removed

[9.0.0-beta.2] - 2024-03-27

⚑ Added

  • Support for .NET Framework 4.6.2

  • #262 [BREAKING CHANGE] Support specifying flushOnClose when creating the sink, thus adding the support to suppress sending unsent log events to the log server before closing the sink (proposed by @murlidakhare, @julichan, @janichirag11 & @prasadpaul53)

    Migration guide

    The parameter flushOnClose has been introduced to the methods Http, DurableHttpUsingFileSizeRolledBuffers and DurableHttpUsingTimeRolledBuffers. Please verify that the arguments pass by you to these methods still align with your intentions.

    To automatically mitigate this kind of new parameter issue in the future, move from using positional arguments to named arguments.

πŸ’« Changed

  • #262 [BREAKING CHANGE] A new argument of type CancellationToken has been added to the PostAsync method of interface IHttpClient.

πŸ’€ Removed

[9.0.0-beta.1] - 2023-04-12

⚑ Added

  • #311 [BREAKING CHANGE] Support specifying levelSwitch when creating the sink, thus adding the support to dynamically change the log level at runtime (contribution by @yuriy-millen)

    Migration guide

    The parameter levelSwitch has been introduced to the methods Http, DurableHttpUsingFileSizeRolledBuffers and DurableHttpUsingTimeRolledBuffers. Please verify that the arguments pass by you to these methods still align with your intentions.

    To automatically mitigate this kind of new parameter issue in the future, move from using positional arguments to named arguments.

[8.0.0] - 2022-04-10

⚑ 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

    The parameter batchSizeLimitBytes has been introduced to the methods Http, DurableHttpUsingFileSizeRolledBuffers and DurableHttpUsingTimeRolledBuffers. Please verify that the arguments pass by you to these methods still align with your intentions.

    To automatically mitigate this kind of new parameter issue in the future, move from using positional arguments to named arguments.

  • #166 Support for content encoding Gzip using HTTP client JsonGzipHttpClient (contribution by @vaibhavepatel, @KalininAndreyVictorovich and @AntonSmolkov)

  • #166 Support for specifying HttpClient when creating JsonHttpClient and JsonGzipHttpClient

πŸ’« Changed

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

    Migration guide

    You'll 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)
        }
      }
    }
  • #162 [BREAKING CHANGE] Deprecated dependency Serilog.Sinks.RollingFile has been removed (discovered by @tipasergio)

    Migration guide

    You'll 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 apply 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 apply 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"
            }
          }
        ]
      }
    }
  • #206 [BREAKING CHANGE] Argument bufferFileSizeLimitBytes to extension methods DurableHttpUsingFileSizeRolledBuffers and DurableHttpUsingTimeRolledBuffers no longer accepts 0 as value

  • #203, #245 [BREAKING CHANGE] Non-durable sink has changed from having its maximum queue size defined as number of events into number of bytes, making it far easier to reason about memory consumption. It's importance to the behavior of the sink was also the reasoning for promoting it from being optional to being mandatory. (proposed by @seruminar)

    Given you are limiting the queue in code you should do the following changes.

    // Before migration
    log = new LoggerConfiguration()
      .WriteTo.Http(
        requestUri: "https://www.mylogs.com",
        queueLimit: 1000)
      .CreateLogger();
    
    // After migration
    log = new LoggerConfiguration()
      .WriteTo.Http(
        requestUri: "https://www.mylogs.com",
        queueLimitBytes: 50 * ByteSize.MB)
      .CreateLogger();

    Given you are limiting the queue in application configuration you should do the following changes.

    // Before migration
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "Http",
            "Args": {
              "requestUri": "https://www.mylogs.com",
              "queueLimit": 1000
            }
          }
        ]
      }
    }
    
    // After migration
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "Http",
            "Args": {
              "requestUri": "https://www.mylogs.com",
              "queueLimitBytes": 52428800
            }
          }
        ]
      }
    }

    Given you aren't limiting the queue in code you should do the following changes.

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

    Given you aren't limiting the queue in application configuration you should do the following changes.

    // Before migration
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "Http",
            "Args": {
              "requestUri": "https://www.mylogs.com"
            }
          }
        ]
      }
    }
    
    // After migration
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "Http",
            "Args": {
              "requestUri": "https://www.mylogs.com",
              "queueLimitBytes": null
            }
          }
        ]
      }
    }
  • #171 [BREAKING CHANGE] Move maximum log event size configuration from batch formatter to sink configuration, and change it's default value from 256 kB to null

    Migration guide

    Given that you're depending on the default maximum log event size configuration in DefaultBatchFormatter or ArrayBatchFormatter, or have defined your own limit when instantiating these classes, you should apply the following changes.

    // Before migration
    log = new LoggerConfiguration()
      // Changes are also applicable to Http and DurableHttpUsingTimeRolledBuffers
      .WriteTo.DurableHttpUsingFileSizeRolledBuffers(
        requestUri: "https://www.mylogs.com",
        batchFormatter: new ArrayBatchFormatter(ByteSize.MB))
      .CreateLogger();
    
    // After migration
    log = new LoggerConfiguration()
      .WriteTo.DurableHttpUsingFileSizeRolledBuffers(
        requestUri: "https://www.mylogs.com",
        logEventLimitBytes: ByteSize.MB,
        batchFormatter: new ArrayBatchFormatter())
      .CreateLogger();
  • #171 [BREAKING CHANGE] Rename sink configuration argument batchPostingLimit to logEventsInBatchLimit

    Migration guide

    Given tha you're defining the maximum number of log events in a single batch, you should apply the following changes.

    // Before migration
    log = new LoggerConfiguration()
      // Changes are also applicable to DurableHttpUsingFileSizeRolledBuffers
      // and DurableHttpUsingTimeRolledBuffers
      .WriteTo.Http(
        requestUri: "https://www.mylogs.com",
        batchPostingLimit: 100,
      .CreateLogger();
    
    // After migration
    log = new LoggerConfiguration()
      .WriteTo.Http(
        requestUri: "https://www.mylogs.com",
        logEventsInBatchLimit: 100,
      .CreateLogger();

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

    // Before migration
    // Changes are also applicable to DurableHttpUsingFileSizeRolledBuffers
    // and DurableHttpUsingTimeRolledBuffers
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "Http",
            "Args": {
              "requestUri": "https://www.mylogs.com",
              "batchPostingLimit": 100
            }
          }
        ]
      }
    }
    
    // After migration
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "Http",
            "Args": {
              "requestUri": "https://www.mylogs.com",
              "logEventsInBatchLimit": 100
            }
          }
        ]
      }
    }
  • [BREAKING CHANGE] Method IHttpClient.Configure on a custom HTTP client implementation is no longer called unless sink is provided an instance of IConfiguration

πŸ’€ Removed

  • #182 [BREAKING CHANGE] Extension method DurableHttp which was marked as deprecated in v5.2.0

    Migration guide

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

    // Before migration
    log = new LoggerConfiguration()
      .WriteTo.DurableHttp(requestUri: "https://www.mylogs.com")
      .CreateLogger();
    
    // After migration
    log = new LoggerConfiguration()
      .WriteTo.DurableHttpUsingTimeRolledBuffers(requestUri: "https://www.mylogs.com")
      .CreateLogger();

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

    // Before migration
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "DurableHttp",
            "Args": {
              "requestUri": "https://www.mylogs.com"
            }
          }
        ]
      }
    }
    
    // After migration
    {
      "Serilog": {
        "WriteTo": [
          {
            "Name": "DurableHttpUsingTimeRolledBuffers",
            "Args": {
              "requestUri": "https://www.mylogs.com"
            }
          }
        ]
      }
    }
  • #215 [BREAKING CHANGE] Remove support for .NET Standard 1.3, aligning with the cross-platform targeting library guidance

  • #196 [BREAKING CHANGE] Overloaded method IBatchFormatter.Format(IEnumerable<LogEvent>, ITextFormatter, TextWriter) has been removed in favour of keeping IBatchFormatter.Format(IEnumerable<string>, TextWriter output)

    Migration guide

    You'll have to migrate your code if you've implemented your own version of IBatchFormatter.

    // Before migration
    public class MyBatchFormatter : IBatchFormatter
    {
      public void Format(IEnumerable<LogEvent> logEvents, ITextFormatter formatter, TextWriter output)
      {
        // Your implementation accepting a sequence of log events
      }
    
      public void Format(IEnumerable<string> logEvents, TextWriter output)
      {
        // Your implementation accepting a sequence of serialized log events
      }
    }
    
    // After migration
    public class MyBatchFormatter : IBatchFormatter
    {
      public void Format(IEnumerable<string> logEvents, TextWriter output)
      {
        // Your implementation accepting a sequence of serialized log events
      }
    }
  • #178 [BREAKING CHANGE] Batch formatter DefaultBatchFormatter was removed when ArrayBatchFormatter was promoted to default batch formatter.

    Migration guide

    You'll have to migrate your code if you used DefaultBatchFormatter, either implicitly by not specifying a batch formatter, or explicitly by specifying DefaultBatchFormatter when configuring the sink.

    Given that you wish to continue using DefaultBatchFormatter as your batch formatter you should copy its implementation from the wiki into your own codebase.

    Given that you decide to migrate into using ArrayBatchFormatter instead of DefaultBatchFormatter, you should verify that your log server is capable of receiving the new JSON payload format.

πŸ’‰ Fixed

  • Durable buffer files are no longer created with an initial BOM
  • #169 Rename buffer files to use the file extension .txt instead of .json
  • #208 Transient dependency conflict for package Microsoft.Extensions.Configuration on ASP.NET Core 2.x (contribution by @AntonSmolkov)
  • #220 - Text formatters NamespacedTextFormatter, NormalRenderedTextFormatter and NormalTextFormatter should write the timestamp in UTC

[7.2.0] - 2020-10-19

⚑ Added

[7.1.0] - 2020-10-18

⚑ 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)

[7.0.1] - 2020-08-14

πŸ’‰ 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

[7.0.0] - 2020-08-12

⚑ Added

[6.0.0] - 2020-05-13

⚑ Added

  • #95 [BREAKING CHANGE] Support to specify bufferFileShared when creating a durable sink, thus allowing the buffer file to be shared by multiple processes (discovered by @esakkiraja-k)

[5.2.1] - 2020-02-16

πŸ’‰ Fixed

  • #97 Make sure the sink respects the exponential backoff, even after numerous unsuccessful attempts to send the log events to a log server (discovered by @markusbrueckner)

[5.2.0] - 2019-04-27

⚑ Added

  • Extension method DurableHttpUsingFileSizeRolledBuffers, creating a durable sink using buffer files with a file size based rolling behavior

πŸ’€ Deprecated

  • Extension method DurableHttp has been renamed to DurableHttpUsingTimeRolledBuffers, providing clarification between the two durable sink types

[5.1.0] - 2019-01-07

⚑ Added

[5.0.1] - 2018-09-24

πŸ’‰ Fixed

  • #54 Prevent durable HTTP sink from posting partially written log events

[5.0.0] - 2018-08-30

⚑ Added

  • #51 [BREAKING CHANGE] Support to specify queueLimit when creating a non-durable sink, limiting the number of events queued in memory waiting to be posted over the network.

[4.3.0] - 2018-02-01

⚑ Added

  • Event formatter called NamespacedTextFormatter suited for a micro-service architecture where log events are sent to the Elastic Stack. The event formatter reduces the risk of two services logging properties with identical names but with different types, which the Elastic Stack doesn't support.

πŸ’€ Removed

  • Support for .NET Standard 2.0 since the sink also has support for .NET Standard 1.3

[4.2.1] - 2017-10-11

πŸ’‰ Fixed

  • #32 Prevent durable HTTP sink from posting HTTP messages without any log events

[4.2.0] - 2017-08-20

⚑ Added

  • Support for .NET Core 2.0

[4.1.0] - 2017-08-13

⚑ Added

  • #22 Batch formatter ArrayBatchFormatter which is compatible with the Logstash HTTP input plugin configured to use the JSON codec

πŸ’‰ Fixed

  • Prevent posting HTTP messages without any log events

[4.0.0] - 2017-06-17

⚑ Added

  • #8 [BREAKING CHANGE] Support for Serilog.Settings.Configuration required changing the extension methods configuring a HTTP sink. Options and DurableOptions no longer exist, and their properties are now optional parameters on the extension methods instead.
  • #11 Support for HTTP body configuration using IBatchFormatter and ITextFormatter. This enables full control of how messages are serialized before being sent over the network. (contribution by @kvpt)
  • #19 Support for specifying the maximum number of retained buffer files and their rotation period on the durable HTTP sink. (contribution by @rob-somerville)

πŸ’« Changed

  • #11 Enum FormattingType has been replaces with public access to the formatters NormalRenderedTextFormatter, NormalTextFormatter, CompactRenderedTextFormatter and CompactTextFormatter. Removing the enum opens up the possibility to specify your own text formatter. (contribution by @kvpt)

[3.1.1] - 2017-04-24

πŸ’‰ Fixed

  • Package project URL

[3.1.0] - 2017-03-12

⚑ Added

  • Support for the formatting types: FormattingType.NormalRendered, FormattingType.Normal, FormattingType.CompactRendered and FormattingType.Compact. The formatting type can be configured via Options and DurableOptions.

[3.0.0] - 2017-03-04

⚑ Added

  • #3 Support for configuring a sink to be durable using Http(string, DurableOptions). A durable sink will persist log events on disk before sending them over the network, thus protecting against data loss after a system or process restart.

πŸ’« Changed

  • [BREAKING CHANGE] The syntax for creating a non-durable sink has been changed from Http(string) to Http(string, Options) to accommodate for the syntax to create a durable sink. A non-durable sink will lose data after a system or process restart.
  • Improve compatibility by supporting .NET Standard 1.3

[2.0.0] - 2016-11-23

πŸ’« Changed

  • #1 [BREAKING CHANGE] Sinks can be configured to use a custom implementation of IHttpClient (contribution by @lhaussknecht)

[1.0.0] - 2016-11-03

Initial version.