Skip to content

Commit

Permalink
adding ILogger<Startup> logger to see the logs (not deep implementation)
Browse files Browse the repository at this point in the history
  • Loading branch information
fMATSINHE committed Jan 4, 2020
1 parent fe88b35 commit 6d27f78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Helloword_core/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace Helloword_core
{
Expand All @@ -19,7 +20,7 @@ public void ConfigureServices(IServiceCollection services)
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILogger<Startup> logger)
{
if (env.IsDevelopment())
{
Expand All @@ -36,6 +37,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env)

app.Run(async (context) =>
{
logger.LogInformation("Response Served.");
await context.Response.WriteAsync("hello word");
});
}
Expand Down

0 comments on commit 6d27f78

Please sign in to comment.