Builder with my serilog common settings for use Console, Seq and Splunk sinks.
Suggested settings
LoggerBuilder builder = new LoggerBuilder();
SeqOptions seqOptions = new SeqOptions
{
Enabled = true,
Url = "http://localhost",
ApiKey = "123456"
};
SplunkOptions splunkOptions = new SplunkOptions
{
Enabled = true,
Url = "http://localhost",
Token = "123456",
Index = "my.index"
};
NewRelicOptions newRelicOptions = new NewRelicOptions
{
Enabled = true,
AppName = "My App",
LicenseKey = "xxxxx"
};
Log.Logger = builder
.UseSuggestedSetting("MyDomain", "MyApplication")
.SetupSeq(seqOptions)
.SetupSplunk(splunkOptions)
.SetupNewRelic(newRelicOptions)
.BuildLogger();
Log.Logger.Debug("Log something");
Custom mode
LoggerBuilder builder = new LoggerBuilder();
Log.Logger = builder
.EnableConsole()
.EnableSeq("http://localhost")
.EnableSplunk("http://localhost")
.EnableNewRelic("My App")
.EnableEnrichWithEnvironment()
.AddEnrichProperty("Application", "MyApp")
.SetMinimumLevel(LogEventLevel.Debug)
.AddOverrideMinimumLevel("System", LogEventLevel.Error)
.BuildLogger();
Log.Logger.Debug("Log something");
PM> Install-Package Serilog.Builder
Please, refer to CONTRIBUTING
Open a new Issue following our issue template ISSUE_TEMPLATE
See in nuget version history
If you liked this project, please make a contribution and help to keep this and other initiatives, send me some Satochis.
BTC Wallet: 1G535x1rYdMo9CNdTGK3eG6XJddBHdaqfX