Skip to content

Commit 9269336

Browse files
committed
Created Splunk configuration
#9
1 parent 15daa74 commit 9269336

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/SampleWebAPI/Startup.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
using Microsoft.AspNetCore.Hosting;
33
using Microsoft.Extensions.Configuration;
44
using Microsoft.Extensions.DependencyInjection;
5-
5+
using Microsoft.Extensions.Logging;
6+
using Splunk.Configurations;
7+
68
namespace VTEX.SampleWebAPI
79
{
810
public class Startup
@@ -21,12 +23,23 @@ public void ConfigureServices(IServiceCollection services)
2123
}
2224

2325
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
24-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
26+
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
2527
{
26-
if (env.IsDevelopment())
28+
loggerFactory.AddDebug();
29+
30+
var splunkConfiguration = new SplunkLoggerConfiguration()
2731
{
28-
app.UseDeveloperExceptionPage();
29-
}
32+
HecConfiguration = new HECConfiguration()
33+
{
34+
SplunkCollectorUrl = "https://localhost:8088/services/collector",
35+
Token = "753c5a9c-fb59-4da0-9064-947f99dc20ba"
36+
},
37+
SocketConfiguration = new SocketConfiguration()
38+
{
39+
HostName = "localhost",
40+
Port = 8111
41+
}
42+
};
3043

3144
app.UseMvc();
3245
}

0 commit comments

Comments
 (0)