Just sniffed what httpEventCollector .NET logging library is doing, I can see its posting following _Json object;
{"time":"1480703033,509","event":{"id":"0","severity":"Information","message":"WannaBeCloudLoggingSystem"}}
This would not work, since its missing index values;
How to set Index within c# Code?
Here is my Code;
var traceSource = new TraceSource("MyConsoleApp");
traceSource.Switch.Level = SourceLevels.All;
traceSource.Listeners.Clear();
var myListener = new HttpEventCollectorTraceListener(
uri: new Uri("https://http-inputs-crapcloudlogger.splunkcloud.com/services/collector/event"),
token: "T O K E N");
myListener.AddLoggingFailureHandler((HttpEventCollectorException e) => {
Console.WriteLine("{0}", e);
});
try
{
traceSource.Listeners.Add(myListener);
}
catch(Exception ex)
{ Console.WriteLine("{0}", ex);
}
traceSource.TraceEvent(TraceEventType.Information,0,"WannaBeCloudLoggingSystem");
... View more