Skip to content

Commit 0895238

Browse files
committed
Extended README to cover basic appsettings.json setup.
1 parent 08a6a6b commit 0895238

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,48 @@ PM> Install-Package Serilog.Sinks.Splunk
2020
OR
2121

2222
```bash
23-
> dotnet add package Serilog.Sinks.Splunk
23+
$ dotnet add package Serilog.Sinks.Splunk
2424
```
2525

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.
2732

2833
```csharp
2934
var log = new LoggerConfiguration()
30-
.WriteTo.EventCollector("https://mysplunk:8088/services/collector", "myeventcollectortoken")
35+
.WriteTo.EventCollector("https://mysplunk:8088/services/collector", "myeventcollectortoken")
3136
.CreateLogger();
3237
```
3338

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+
```
3563

64+
More information about Serilog is available on the [wiki](https://github.com/serilog/serilog-sinks-splunk/wiki).
3665
### Build status
3766

3867
Branch | AppVeyor | Travis

0 commit comments

Comments
 (0)