File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 4
4
using Microsoft . Extensions . DependencyInjection ;
5
5
using Microsoft . Extensions . Logging ;
6
6
using Microsoft . Extensions . Options ;
7
- using Splunk ;
8
7
using Splunk . Configurations ;
9
8
10
9
namespace Splunk . SampleWebAPI
@@ -36,13 +35,15 @@ public void ConfigureServices(IServiceCollection services)
36
35
/// <param name="loggerFactory">Logger factory.</param>
37
36
public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory )
38
37
{
39
- //loggerFactory.AddDebug();
40
-
41
- var splunkLoggerConfigurationOption = app . ApplicationServices . GetService < IOptions < SplunkLoggerConfiguration > > ( ) ;
42
-
38
+
43
39
/******************************** Define Your Logger *********************************/
44
40
/* */
45
- loggerFactory . AddHECRawSplunkLogger ( splunkLoggerConfigurationOption . Value ) ; //
41
+ // Get Configuration to be used at Logger //
42
+ var splunkLoggerConfiguration = GetSplunkLoggerConfiguration ( app ) ;
43
+ // //
44
+ // Choose one or more of those loggers //
45
+ // //
46
+ loggerFactory . AddHECRawSplunkLogger ( splunkLoggerConfiguration ) ; //
46
47
// //
47
48
// //
48
49
//loggerFactory.AddHECJsonSplunkLogger(splunkConfiguration); //
You can’t perform that action at this time.
0 commit comments