File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 22using Microsoft . AspNetCore . Hosting ;
33using Microsoft . Extensions . Configuration ;
44using Microsoft . Extensions . DependencyInjection ;
5-
5+ using Microsoft . Extensions . Logging ;
6+ using Splunk . Configurations ;
7+
68namespace 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 }
You can’t perform that action at this time.
0 commit comments