Skip to content

Commit 138163e

Browse files
committed
Corrected batch size
1 parent a195cdc commit 138163e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Serilog.Sinks.Splunk/LoggerConfigurationSplunkPCLExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static LoggerConfiguration SplunkViaEventCollector(
5151
IFormatProvider formatProvider = null,
5252
bool renderTemplate = true,
5353
int batchIntervalInSeconds = 2,
54-
int batchSizeLimit = 10)
54+
int batchSizeLimit = 100)
5555
{
5656
if (configuration == null) throw new ArgumentNullException(nameof(configuration));
5757
if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate));

src/Serilog.Sinks.Splunk/Sinks/Splunk/EventCollectorSink.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public EventCollectorSink(
8080

8181
_httpClient = new EventCollectorClient(_eventCollectorToken);
8282

83-
//TODO: Implement handling similar to the Seq HTTP sink
83+
//TODO: Implement handling similar to the Seq HTTP sink, including dispose flush
8484

8585
RepeatAction.OnInterval(_batchInterval, () => ProcessQueue().Wait(), new CancellationToken());
8686

@@ -163,11 +163,12 @@ private async Task ProcessQueue()
163163
var sw = new StringWriter();
164164

165165
_jsonFormatter.Format(logEvent, sw);
166-
var le = sw.ToString();
167-
var request = new EventCollectorRequest(_splunkHost, le, _source, _sourceType, _host, _index);
166+
var evt = sw.ToString();
167+
168+
var request = new EventCollectorRequest(_splunkHost, evt, _source, _sourceType, _host, _index);
168169
var response = await _httpClient.SendAsync(request);
169170

170-
if (response.IsSuccessStatusCode) { //Do Nothing?
171+
if (response.IsSuccessStatusCode) { //Do Nothing?
171172
}
172173
else
173174
{

0 commit comments

Comments
 (0)