I'm considering to use serilog for my app. We have .net core 2.1 app. Want to push application logs to splunk. So I've options where I can use Serilog.Sinks.Splunk and push logs WriteTo.EventCollector (specific index is configured in splunk) Another option is I can write logs to files using witeto.File and use forwarder logs can be available in splunk.
Configuration looks like
Serilog.Core.Logger logger= new LoggerConfiguration()
.MinimumLevel.Information()
.WriteTo.EventCollector(<host>,<token> ,new CompactSplunkJsonFormatter())
.CreateLogger();
In this regard need suggestion
- Which of the above approaches are better?
- Is there any performance difference of
WriteTo.EventCollector
Vswiteto.File
in serilog? - Can there be any performance impact if I use above configuration? Any more configuration can be used along with this for better performance?