Skip to content

Commit a195cdc

Browse files
committed
Comments on streaming enhancement
1 parent 00c699e commit a195cdc

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/Serilog.Sinks.Splunk/Sinks/Splunk/EventCollectorRequest.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ namespace Serilog.Sinks.Splunk
66
{
77
internal class EventCollectorRequest : HttpRequestMessage
88
{
9-
public EventCollectorRequest(
9+
internal EventCollectorRequest(string splunkHost, string jsonPayLoad)
10+
{
11+
12+
var stringContent = new StringContent(jsonPayLoad, Encoding.UTF8, "application/json");
13+
RequestUri = new Uri(splunkHost);
14+
Content = stringContent;
15+
Method = HttpMethod.Post;
16+
}
17+
18+
internal EventCollectorRequest(
1019
string splunkHost,
1120
string logEvent,
1221
string source,

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,11 @@ private async Task ProcessQueue()
153153
if (events.Count == 0)
154154
return;
155155

156-
//TODO: Add streaming capability for performance. This should b
157-
156+
//TODO: Add streaming capability for performance.
157+
// - Stream writer needs to move to outer scope.
158+
// - Change Event Collector Request to only take string (or stream) of events and host
159+
// - New object to stream many events as collection
160+
158161
foreach (var logEvent in events)
159162
{
160163
var sw = new StringWriter();

0 commit comments

Comments
 (0)