Releases: FantasticFiasco/serilog-sinks-http
Release v8.0.0-beta.6
💉 Fixed
- #190 Add data flushing from GzipStream to underlying stream (contribution by @AntonSmolkov)
Release v8.0.0-beta.5
💫 Changed
- #162 [BREAKING CHANGE] Deprecated dependency Serilog.Sinks.RollingFile has been removed (discovered by @tipasergio)
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
💉 Fixed
- #188 Remove BOM from HTTP streams (discovered by @KalininAndreyVictorovich
Release v8.0.0-beta.3
⚡ Added
- #166 Support for content encoding Gzip using HTTP client
JsonGzipHttpClient
(contribution by @vaibhavepatel and @KalininAndreyVictorovich)
💫 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
💉 Fixed
- Durable buffer files are no longer created with an initial BOM
Release v8.0.0-beta.1
⚡ 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
⚡ Added
- Support for .NET Standard 2.1 (contributed by @augustoproiete)
Release v7.1.0
⚡ Added
- Add class
ByteSize
which helps specifying multipliers of the unit byte.
💉 Fixed
- #135 The type
IConfiguration
exists in bothMicrosoft.Extensions.Configuration.Abstractions
andSerilog.Sinks.Http
(discovered by @brian-pickens-web and contributed by @aleksaradz)
Release v7.0.1
💉 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
⚡ Added
- #49, #123 [BREAKING CHANGE] Improve support for configuring HTTP client when using Serilog.Settings.Configuration. See Custom HTTP client in wiki for more information. (discovered by @brunorsantos)