-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from IdentityStream/feature/bump
Bump to latest dependencies
- Loading branch information
Showing
3 changed files
with
31 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
using Serilog.Configuration; | ||
using Serilog.Events; | ||
using Serilog.Sinks.PeriodicBatching; | ||
using System; | ||
|
||
namespace Serilog.Sinks.Humio { | ||
public static class HumioSinkExtensions { | ||
public static LoggerConfiguration Humio( | ||
this LoggerSinkConfiguration loggerConfiguration, | ||
string ingestToken = null, string url = "https://cloud.humio.com", LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { | ||
return loggerConfiguration.Sink(new Humio(ingestToken, url), restrictedToMinimumLevel); | ||
var batchingOptions = new PeriodicBatchingSinkOptions | ||
{ | ||
Period = TimeSpan.FromSeconds(5), | ||
BatchSizeLimit = 10, | ||
}; | ||
var sink = new PeriodicBatchingSink(new Humio(ingestToken, url), batchingOptions); | ||
return loggerConfiguration.Sink(sink, restrictedToMinimumLevel); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters