|
|
@ -16,22 +16,22 @@ namespace Win_in.Sfs.Scp.WebApi |
|
|
|
.AddJsonFile("appsettings.json", false, true) |
|
|
|
.Build(); |
|
|
|
|
|
|
|
// Log.Logger = new LoggerConfiguration()
|
|
|
|
// .ReadFrom.Configuration(configuration)
|
|
|
|
// .CreateLogger();
|
|
|
|
|
|
|
|
Log.Logger = new LoggerConfiguration() |
|
|
|
#if DEBUG
|
|
|
|
.MinimumLevel.Debug() |
|
|
|
#else
|
|
|
|
.MinimumLevel.Information() |
|
|
|
#endif
|
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt",rollingInterval:RollingInterval.Day)) |
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
.CreateLogger(); |
|
|
|
Log.Logger = new LoggerConfiguration() |
|
|
|
.ReadFrom.Configuration(configuration) |
|
|
|
.CreateLogger(); |
|
|
|
//
|
|
|
|
// Log.Logger = new LoggerConfiguration()
|
|
|
|
// #if DEBUG
|
|
|
|
// .MinimumLevel.Debug()
|
|
|
|
// #else
|
|
|
|
// .MinimumLevel.Information()
|
|
|
|
// #endif
|
|
|
|
// .MinimumLevel.Override("Microsoft", LogEventLevel.Information)
|
|
|
|
// .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
|
|
|
|
// .Enrich.FromLogContext()
|
|
|
|
// .WriteTo.Async(c => c.File("Logs/logs.txt",rollingInterval:RollingInterval.Day))
|
|
|
|
// .WriteTo.Async(c => c.Console())
|
|
|
|
// .CreateLogger();
|
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|