Skip to content

Commit 98e8457

Browse files
authored
Merge pull request #85 from merbla/bug-issue-64
Remove outputTemplate from HEC extensions
2 parents 1183dbc + 74d0d2f commit 98e8457

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,5 @@ _Pvt_Extensions
234234

235235
# FAKE - F# Make
236236
.fake/
237+
238+
.vscode/

run_sample.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
sh build.sh
33

4-
cd sample
5-
dotnet run 15
4+
cd sample/Sample
5+
dotnet run 15 -f netcoreapp2.0
66
cd ..

src/Serilog.Sinks.Splunk/SplunkLoggingConfigurationExtensions.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ namespace Serilog
2828
/// </summary>
2929
public static class SplunkLoggingConfigurationExtensions
3030
{
31-
internal const string DefaultOutputTemplate =
32-
"{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}";
33-
3431
internal const string DefaultSource = "";
3532
internal const string DefaultSourceType = "";
3633
internal const string DefaultHost = "";
@@ -48,7 +45,6 @@ public static class SplunkLoggingConfigurationExtensions
4845
/// <param name="sourceType">The source type of the event</param>
4946
/// <param name="host">The host of the event</param>
5047
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
51-
/// <param name="outputTemplate">The output template to be used when logging</param>
5248
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
5349
/// <param name="renderTemplate">If true, the message template will be rendered</param>
5450
/// <param name="batchIntervalInSeconds">The interval in seconds that the queue should be instpected for batching</param>
@@ -66,7 +62,6 @@ public static LoggerConfiguration EventCollector(
6662
string host = DefaultHost,
6763
string index = DefaultIndex,
6864
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
69-
string outputTemplate = DefaultOutputTemplate,
7065
IFormatProvider formatProvider = null,
7166
bool renderTemplate = true,
7267
int batchIntervalInSeconds = 2,
@@ -75,7 +70,6 @@ public static LoggerConfiguration EventCollector(
7570
LoggingLevelSwitch levelSwitch = null)
7671
{
7772
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
78-
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));
7973

8074
var eventCollectorSink = new EventCollectorSink(
8175
splunkHost,
@@ -103,7 +97,7 @@ public static LoggerConfiguration EventCollector(
10397
/// <param name="jsonFormatter">The text formatter used to render log events into a JSON format for consumption by Splunk</param>
10498
/// <param name="uriPath">Change the default endpoint of the Event Collector e.g. services/collector/event</param>
10599
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
106-
/// <param name="outputTemplate">The output template to be used when logging</param>
100+
107101
/// <param name="batchIntervalInSeconds">The interval in seconds that the queue should be instpected for batching</param>
108102
/// <param name="batchSizeLimit">The size of the batch</param>
109103
/// <param name="messageHandler">The handler used to send HTTP requests</param>
@@ -116,15 +110,13 @@ public static LoggerConfiguration EventCollector(
116110
ITextFormatter jsonFormatter,
117111
string uriPath = "services/collector",
118112
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
119-
string outputTemplate = DefaultOutputTemplate,
120113
int batchIntervalInSeconds = 2,
121114
int batchSizeLimit = 100,
122115
HttpMessageHandler messageHandler = null,
123116
LoggingLevelSwitch levelSwitch = null)
124117
{
125118
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
126119
if (jsonFormatter == null) throw new ArgumentNullException(nameof(jsonFormatter));
127-
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));
128120

129121
var eventCollectorSink = new EventCollectorSink(
130122
splunkHost,
@@ -151,7 +143,6 @@ public static LoggerConfiguration EventCollector(
151143
/// <param name="sourceType">The source type of the event</param>
152144
/// <param name="host">The host of the event</param>
153145
/// <param name="restrictedToMinimumLevel">The minimum log event level required in order to write an event to the sink.</param>
154-
/// <param name="outputTemplate">The output template to be used when logging</param>
155146
/// <param name="formatProvider">Supplies culture-specific formatting information, or null.</param>
156147
/// <param name="renderTemplate">If ture, the message template will be rendered</param>
157148
/// <param name="batchIntervalInSeconds">The interval in seconds that the queue should be instpected for batching</param>
@@ -171,7 +162,6 @@ public static LoggerConfiguration EventCollector(
171162
string host = DefaultHost,
172163
string index = DefaultIndex,
173164
LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum,
174-
string outputTemplate = DefaultOutputTemplate,
175165
IFormatProvider formatProvider = null,
176166
bool renderTemplate = true,
177167
int batchIntervalInSeconds = 2,
@@ -180,7 +170,6 @@ public static LoggerConfiguration EventCollector(
180170
LoggingLevelSwitch levelSwitch = null)
181171
{
182172
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
183-
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));
184173

185174
var eventCollectorSink = new EventCollectorSink(
186175
splunkHost,

0 commit comments

Comments
 (0)