public void Configure() { var generalSplunkContext = new global::Splunk.Client.Context(Scheme.Https, "127.0.0.1", 8089); var transmitterArgs = new TransmitterArgs { Source = "Splunk.Sample", SourceType = "Splunk Sample Source" }; const string username = "******"; const string password = "******"; const string splunkIndex = "mysplunktest"; var serilogContext = new SplunkContext( generalSplunkContext, splunkIndex, username, password, null, transmitterArgs); Log.Logger = new LoggerConfiguration() .WriteTo.LiterateConsole() .WriteTo.SplunkViaHttp(serilogContext, 100, TimeSpan.FromSeconds(10)) .Enrich.WithThreadId() .Enrich.WithProperty("SplunkSample", "ViaHttp") .MinimumLevel.Debug() .CreateLogger(); }
public void Configure() { var generalSplunkContext = new global::Splunk.Client.Context(Scheme.Https, "127.0.0.1", 8089); var transmitterArgs = new TransmitterArgs { Source = "Splunk.Sample", SourceType = "Splunk Sample Source" }; const string username = "******"; const string password = "******"; const string splunkIndex = "mysplunktest"; var serilogContext = new SplunkContext( generalSplunkContext, splunkIndex, username, password, null, transmitterArgs); Log.Logger = new LoggerConfiguration() .WriteTo.LiterateConsole() .WriteTo.SplunkViaHttp(serilogContext, 100, TimeSpan.FromSeconds(10)) .Enrich.WithThreadId() .Enrich.WithProperty("SplunkSample", "ViaHttp") .MinimumLevel.Debug() .CreateLogger(); }