Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the dotnet core docs be improved? #87

Open
aschaible opened this issue Sep 17, 2019 · 1 comment
Open

Can the dotnet core docs be improved? #87

aschaible opened this issue Sep 17, 2019 · 1 comment

Comments

@aschaible
Copy link

Could you please specify how to use appsettings.json to configure the parameters of the SumoLogic appender? Perhaps it's impossible for the URI to be auto-configured through the json file?

@natehitze
Copy link

natehitze commented Dec 11, 2019

I know it's been a few months since you asked this question but hopefully this is helpful for others. Currently this is what I use to leverage core's configuration system.

On startup:

WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>()
                .ConfigureLogging((context, logging) =>
                {
                    var sumoLogicOptions = context.Configuration.GetSection("Logging:SumoLogic").Get<LoggerOptions>();
                    logging.AddSumoLogic(sumoLogicOptions);
                });

Then in your appsettings.json you can put something like:

{
    "Logging": {
        "SumoLogic": {
            "Uri": "https://collectorurlhere"
        }
    }
}

You can see the available options in the Logger Options file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants