Serilog.Sinks.PeriodicBatching 4.1.2-dev-00851
Serilog.Sinks.PeriodicBatching
A wrapper for Serilog sinks that asynchronously emits events in batches, useful when logging to a slow and/or remote target.
Getting started
Sinks that, for performance reasons, need to emit events in batches, can be implemented using PeriodicBatchingSink
from this package.
First, install the package into your Sink project:
dotnet add package Serilog.Sinks.PeriodicBatching
Then, instead of implementing Serilog's ILogEventSink
, implement IBatchedLogEventSink
in your sink class:
class ExampleBatchedSink : IBatchedLogEventSink
{
public async Task EmitBatchAsync(IEnumerable<LogEvent> batch)
{
foreach (var logEvent in batch)
Console.WriteLine(logEvent);
}
public Task OnEmptyBatchAsync() { }
}
Finally, in your sink's configuration method, construct a PeriodicBatchingSink
that wraps your batched sink:
public static class LoggerSinkExampleConfiguration
{
public static LoggerConfiguration Example(this LoggerSinkConfiguration loggerSinkConfiguration)
{
var exampleSink = new ExampleBatchedSink();
var batchingOptions = new PeriodicBatchingSinkOptions
{
BatchSizeLimit = 100,
Period = TimeSpan.FromSeconds(2),
EagerlyEmitFirstEvent = true,
QueueLimit = 10000
};
var batchingSink = new PeriodicBatchingSink(exampleSink, batchingOptions);
return loggerSinkConfiguration.Sink(batchingSink);
}
}
Showing the top 20 packages that depend on Serilog.Sinks.PeriodicBatching.
Packages | Downloads |
---|---|
Serilog.Sinks.Elasticsearch
Package Description
|
53 |
Serilog.Sinks.Elasticsearch
Package Description
|
55 |
Serilog.Sinks.Elasticsearch
Package Description
|
57 |
Serilog.Sinks.Elasticsearch
Package Description
|
60 |
Serilog.Sinks.Elasticsearch
Package Description
|
62 |
Serilog.Sinks.Elasticsearch
Package Description
|
70 |
Serilog.Sinks.Elasticsearch
Package Description
|
73 |
Serilog.Sinks.Elasticsearch
Package Description
|
76 |
Serilog.Sinks.Elasticsearch
Package Description
|
79 |
Serilog.Sinks.Elasticsearch
Package Description
|
88 |
Serilog.Sinks.Elasticsearch
Package Description
|
106 |
Serilog.Sinks.Elasticsearch
Package Description
|
1,876 |
Serilog.Sinks.Elasticsearch
Package Description
|
3,185 |
Serilog.Sinks.Elasticsearch
Package Description
|
25,019 |
Serilog.Sinks.Elasticsearch
Serilog sink for Elasticsearch
|
55 |
Serilog.Sinks.Elasticsearch
Serilog.Sinks.Elasticsearch
|
92 |
Serilog.Sinks.Elasticsearch
Serilog.Sinks.Elasticsearch
|
95 |
Serilog.Sinks.Elasticsearch
The perfect way for .NET apps to write structured log events to Elasticsearch 2.x.
|
60 |
.NET Framework 4.6.2
- Serilog (>= 3.1.1)
- System.Threading.Channels (>= 8.0.0)
.NET 6.0
- Serilog (>= 3.1.1)
.NET Standard 2.0
- Serilog (>= 3.1.1)
- System.Threading.Channels (>= 8.0.0)
Version | Downloads | Last updated |
---|---|---|
5.0.1-dev-00860 | 14 | 07/04/2024 |
5.0.0 | 10 | 06/07/2024 |
5.0.0-dev-00855 | 8 | 06/08/2024 |
4.1.2-dev-00851 | 12 | 06/01/2024 |
4.1.1 | 9 | 05/31/2024 |
4.1.1-dev-00845 | 17 | 05/24/2024 |
4.1.0 | 12 | 05/21/2024 |
4.1.0-dev-00840 | 13 | 05/21/2024 |
4.0.2-dev-00838 | 13 | 05/21/2024 |
4.0.1 | 7 | 03/15/2024 |
4.0.1-dev-00832 | 13 | 03/16/2024 |
4.0.0 | 11 | 03/07/2024 |
4.0.0-dev-00824 | 11 | 03/10/2024 |
4.0.0-dev-00821 | 10 | 03/10/2024 |
3.1.1-dev-00804 | 27 | 06/23/2023 |
3.1.1-dev-00801 | 40 | 10/27/2022 |
3.1.0 | 60 | 10/27/2022 |
3.1.0-dev-00796 | 34 | 09/23/2022 |
3.0.0 | 62 | 09/22/2022 |
3.0.0-dev-00792 | 46 | 09/24/2022 |
2.3.1 | 42 | 07/11/2022 |
2.3.1-dev-00785 | 41 | 09/12/2022 |
2.3.1-dev-00780 | 53 | 09/12/2022 |
2.3.1-dev-00776 | 31 | 09/12/2022 |
2.3.1-dev-00774 | 39 | 09/21/2022 |
2.3.0 | 58 | 07/29/2022 |
2.3.0-dev-00765 | 28 | 09/12/2022 |
2.3.0-dev-00762 | 47 | 06/30/2022 |
2.3.0-dev-00760 | 40 | 09/23/2022 |
2.2.1-dev-00758 | 64 | 09/21/2022 |
2.2.1-dev-00755 | 97 | 09/12/2022 |
2.2.0 | 36 | 09/12/2022 |
2.2.0-dev-00748 | 51 | 09/22/2022 |
2.2.0-dev-00740 | 39 | 09/12/2022 |
2.1.1 | 25,526 | 06/27/2022 |
2.1.1-dev-00732 | 33 | 09/17/2022 |
2.1.1-dev-00729 | 51 | 09/21/2022 |
2.1.1-dev-00725 | 37 | 09/12/2022 |
2.1.0 | 30 | 09/17/2022 |
2.1.0-dev-00720 | 27 | 09/12/2022 |
2.0.2-dev-00719 | 30 | 09/22/2022 |
2.0.1 | 28 | 09/12/2022 |
2.0.1-dev-00714 | 42 | 09/12/2022 |
2.0.0 | 76 | 09/25/2022 |
2.0.0-rc-707 | 20 | 09/12/2022 |
2.0.0-rc-705 | 22 | 10/27/2022 |
2.0.0-beta-702 | 36 | 09/12/2022 |
2.0.0-beta-700 | 48 | 09/12/2022 |
2.0.0-beta-519 | 45 | 09/17/2022 |
2.0.0-beta-516 | 33 | 09/12/2022 |
2.0.0-beta-513 | 67 | 09/12/2022 |
2.0.0-beta-511 | 51 | 09/12/2022 |
2.0.0-beta-509 | 53 | 09/12/2022 |
2.0.0-beta-507 | 108 | 09/12/2022 |
2.0.0-beta-505 | 86 | 09/12/2022 |
2.0.0-beta-502 | 19 | 09/24/2022 |
2.0.0-beta-499 | 53 | 09/12/2022 |
2.0.0-beta-495 | 62 | 09/12/2022 |
2.0.0-beta-494 | 47 | 07/03/2022 |
2.0.0-beta-493 | 73 | 09/22/2022 |
2.0.0-beta-487 | 71 | 09/12/2022 |
2.0.0-beta-486 | 56 | 09/12/2022 |
2.0.0-beta-479 | 49 | 09/22/2022 |
2.0.0-beta-478 | 43 | 09/12/2022 |
2.0.0-beta-465 | 37 | 09/12/2022 |