Created
April 11, 2018 12:00
-
-
Save configureappio/f3cf0982bf92106ddf46927fdab46c88 to your computer and use it in GitHub Desktop.
Example of Startup Class adding a logging provider by convention
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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