mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-07-01 11:02:57 +00:00
Add logging
This commit is contained in:
parent
9ce824147d
commit
c31cc99844
@ -12,6 +12,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@ -49,6 +50,12 @@ builder.Services.AddApiUser();
|
||||
|
||||
builder.Services.AddMediatR(cfg => { cfg.RegisterServicesFromAssemblies(typeof(Program).Assembly); });
|
||||
|
||||
builder.Services.AddLogging(x => x.AddSimpleConsole(console =>
|
||||
{
|
||||
console.TimestampFormat = "[yyyy-MM-ddTHH:mm:ss.fff] ";
|
||||
console.IncludeScopes = true;
|
||||
}));
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
using (var scope = app.Services.CreateScope())
|
||||
|
Loading…
Reference in New Issue
Block a user