正在尝试将日志从.NET应用程序发布到Splunk云。下面是源代码。请让我知道是否缺少任何东西。
public bool SendDataToSplunk()
{
var middleware = new HttpEventCollectorResendMiddleware(100);
var ecSender = new HttpEventCollectorSender(new Uri("https://prd-p-pqh9ws5tppvf.cloud.splunk.com"),
"c5731f11-dd2b-4261-ac68-7292d1bcb6a4",
null,
HttpEventCollectorSender.SendMode.Sequential,
0,
0,
0,
middleware.Plugin
);
ecSender.OnError += o => Console.WriteLine(o.Message);
ecSender.Send(Guid.NewGuid().ToString(), "INFO", null, new { Foo = "Foo" });
ecSender.FlushSync();
return true;
}
我希望日志记录应该在Splunk云中进行。但这没有发生。