Skip to content

Instantly share code, notes, and snippets.

@configureappio
Created April 11, 2018 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save configureappio/f3cf0982bf92106ddf46927fdab46c88 to your computer and use it in GitHub Desktop.
Save configureappio/f3cf0982bf92106ddf46927fdab46c88 to your computer and use it in GitHub Desktop.
Example of Startup Class adding a logging provider by convention
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory logFactory)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
logFactory.AddProvider(new DummyLogprovider());
app.UseMvc();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment