Skip to content

Instantly share code, notes, and snippets.

@glennblock
Last active August 29, 2015 14:18
Show Gist options
  • Save glennblock/48f2b67ac296226f6d7d to your computer and use it in GitHub Desktop.
Save glennblock/48f2b67ac296226f6d7d to your computer and use it in GitHub Desktop.
private static void BatchLoggingByBytes()
{
_listener = new HttpInputTraceListener(_host, _token, batchSizeBytes: 100);
_traceSource.Listeners.Add(_listener);
for (int i = 1; i <= 5; i++)
_traceSource.TraceEvent(TraceEventType.Information, i, string.Format("Boris {0}", i));
Prompt("Logged 5 events, data has not been sent yet as it did not hit 100 bytes, press enter to continue");
for (int i = 6; i <= 10; i++)
_traceSource.TraceEvent(TraceEventType.Information, i, string.Format("Boris {0}", i));
Prompt("Logged 5 events, data should have been sent to Splunk, press enter to continue");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment