diff --git a/sample/Sample/Sample.csproj b/sample/Sample/Sample.csproj
index 541aaa2..529ff7b 100644
--- a/sample/Sample/Sample.csproj
+++ b/sample/Sample/Sample.csproj
@@ -2,12 +2,19 @@
Exe
- netcoreapp2.0
+ netcoreapp2.0;net47
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/Serilog.Sinks.Splunk/Serilog.Sinks.Splunk.csproj b/src/Serilog.Sinks.Splunk/Serilog.Sinks.Splunk.csproj
index f18aaa6..80e0304 100644
--- a/src/Serilog.Sinks.Splunk/Serilog.Sinks.Splunk.csproj
+++ b/src/Serilog.Sinks.Splunk/Serilog.Sinks.Splunk.csproj
@@ -2,7 +2,7 @@
The Splunk Sink for Serilog
- 2.4.0
+ 2.5.0
Matthew Erbs, Serilog Contributors
net45;netstandard1.1;netstandard1.3
true
@@ -15,6 +15,10 @@
false
+
+ $(DefineConstants);TCP;UDP
+
+
@@ -22,22 +26,18 @@
-
- $(DefineConstants);TCP;UDP
-
-
+
-
+
-
diff --git a/src/Serilog.Sinks.Splunk/SplunkLoggingConfigurationExtensions.cs b/src/Serilog.Sinks.Splunk/SplunkLoggingConfigurationExtensions.cs
index 50ef4e6..f85705f 100644
--- a/src/Serilog.Sinks.Splunk/SplunkLoggingConfigurationExtensions.cs
+++ b/src/Serilog.Sinks.Splunk/SplunkLoggingConfigurationExtensions.cs
@@ -16,6 +16,7 @@
using System;
using System.Net.Http;
using Serilog.Configuration;
+using Serilog.Core;
using Serilog.Events;
using Serilog.Formatting;
using Serilog.Sinks.Splunk;
@@ -53,6 +54,7 @@ public static class SplunkLoggingConfigurationExtensions
/// The interval in seconds that the queue should be instpected for batching
/// The size of the batch
/// The handler used to send HTTP requests
+ /// A switch allowing the pass-through minimum level to be changed at runtime.
///
public static LoggerConfiguration EventCollector(
this LoggerSinkConfiguration configuration,
@@ -69,7 +71,8 @@ public static LoggerConfiguration EventCollector(
bool renderTemplate = true,
int batchIntervalInSeconds = 2,
int batchSizeLimit = 100,
- HttpMessageHandler messageHandler = null)
+ HttpMessageHandler messageHandler = null,
+ LoggingLevelSwitch levelSwitch = null)
{
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));
@@ -88,7 +91,7 @@ public static LoggerConfiguration EventCollector(
renderTemplate,
messageHandler);
- return configuration.Sink(eventCollectorSink, restrictedToMinimumLevel);
+ return configuration.Sink(eventCollectorSink, restrictedToMinimumLevel, levelSwitch);
}
///
@@ -104,6 +107,7 @@ public static LoggerConfiguration EventCollector(
/// The interval in seconds that the queue should be instpected for batching
/// The size of the batch
/// The handler used to send HTTP requests
+ /// A switch allowing the pass-through minimum level to be changed at runtime.
///
public static LoggerConfiguration EventCollector(
this LoggerSinkConfiguration configuration,
@@ -115,7 +119,8 @@ public static LoggerConfiguration EventCollector(
string outputTemplate = DefaultOutputTemplate,
int batchIntervalInSeconds = 2,
int batchSizeLimit = 100,
- HttpMessageHandler messageHandler = null)
+ HttpMessageHandler messageHandler = null,
+ LoggingLevelSwitch levelSwitch = null)
{
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
if (jsonFormatter == null) throw new ArgumentNullException(nameof(jsonFormatter));
@@ -130,10 +135,10 @@ public static LoggerConfiguration EventCollector(
jsonFormatter,
messageHandler);
- return configuration.Sink(eventCollectorSink, restrictedToMinimumLevel);
+ return configuration.Sink(eventCollectorSink, restrictedToMinimumLevel, levelSwitch);
}
-
+
///
/// Adds a sink that writes log events as to a Splunk instance via the HTTP Event Collector.
///
@@ -152,6 +157,7 @@ public static LoggerConfiguration EventCollector(
/// The interval in seconds that the queue should be instpected for batching
/// The size of the batch
/// The handler used to send HTTP requests
+ /// A switch allowing the pass-through minimum level to be changed at runtime.
/// Customfields that will be indexed in splunk with this event
///
public static LoggerConfiguration EventCollector(
@@ -170,7 +176,8 @@ public static LoggerConfiguration EventCollector(
bool renderTemplate = true,
int batchIntervalInSeconds = 2,
int batchSizeLimit = 100,
- HttpMessageHandler messageHandler = null)
+ HttpMessageHandler messageHandler = null,
+ LoggingLevelSwitch levelSwitch = null)
{
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));
@@ -191,7 +198,7 @@ public static LoggerConfiguration EventCollector(
messageHandler
);
- return configuration.Sink(eventCollectorSink, restrictedToMinimumLevel);
+ return configuration.Sink(eventCollectorSink, restrictedToMinimumLevel, levelSwitch);
}
}
}
\ No newline at end of file
diff --git a/test/Serilog.Sinks.Splunk.Tests/Serilog.Sinks.Splunk.Tests.csproj b/test/Serilog.Sinks.Splunk.Tests/Serilog.Sinks.Splunk.Tests.csproj
index 40da3da..9f8c25f 100644
--- a/test/Serilog.Sinks.Splunk.Tests/Serilog.Sinks.Splunk.Tests.csproj
+++ b/test/Serilog.Sinks.Splunk.Tests/Serilog.Sinks.Splunk.Tests.csproj
@@ -19,6 +19,7 @@
+
@@ -26,11 +27,15 @@
-
+
-
+
+
+
+
+