@@ -20,19 +20,48 @@ PM> Install-Package Serilog.Sinks.Splunk
20
20
OR
21
21
22
22
``` bash
23
- > dotnet add package Serilog.Sinks.Splunk
23
+ $ dotnet add package Serilog.Sinks.Splunk
24
24
```
25
25
26
- Using the Event Collector (Splunk 6.3 and above)
26
+ If using the ` TCP ` or ` UDP ` sinks install the following packages
27
+
28
+ * TCP: ` Serilog.Sinks.Splunk.TCP `
29
+ * UDP: ` Serilog.Sinks.Splunk.UDP `
30
+
31
+ To start using the Splunk Event Collector (Splunk 6.3 and above), logging can be setup as follows.
27
32
28
33
``` csharp
29
34
var log = new LoggerConfiguration ()
30
- .WriteTo .EventCollector (" https://mysplunk:8088/services/collector" , " myeventcollectortoken" )
35
+ .WriteTo .EventCollector (" https://mysplunk:8088/services/collector" , " myeventcollectortoken" )
31
36
.CreateLogger ();
32
37
```
33
38
34
- More information is available on the [ wiki] ( https://github.com/serilog/serilog-sinks-splunk/wiki ) .
39
+ If using ` appsettings.json ` for configuration the following example illustrates using the Event Collector and Console sinks.
40
+
41
+ ``` javascript
42
+ {
43
+ " Serilog" : {
44
+ " Using" : [" Serilog.Sinks.Console" , " Serilog.Sinks.Splunk" ],
45
+ " MinimumLevel" : " Information" ,
46
+ " WriteTo" : [{
47
+ " Name" : " Console"
48
+ },
49
+ {
50
+ " Name" : " EventCollector" ,
51
+ " Args" : {
52
+ " splunkHost" : " http://splunk:8088" ,
53
+ " eventCollectorToken" : " 00112233-4455-6677-8899-AABBCCDDEEFF"
54
+ }
55
+ }
56
+ ],
57
+ " Properties" : {
58
+ " Application" : " Serilog Splunk Console Sample"
59
+ }
60
+ }
61
+ }
62
+ ```
35
63
64
+ More information about Serilog is available on the [ wiki] ( https://github.com/serilog/serilog-sinks-splunk/wiki ) .
36
65
### Build status
37
66
38
67
Branch | AppVeyor | Travis
0 commit comments