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