Created
April 30, 2020 13:45
-
-
Save CoreProgramm/c23502c2dc73b63bfff244880b10af89 to your computer and use it in GitHub Desktop.
Custom Middleware
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 void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory logFactory) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); | |
} | |
app.UseCustomLoggerMiddleware(); | |
app.Run(async (context) => | |
{ | |
await context.Response.WriteAsync("Hello World check from Run method!"); | |
}); | |
logFactory.AddFile("Logs/myapp-{Date}.txt"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment