Browse Source
Merge pull request #12286 from abpframework/liangshiwei/template
No layers template missing console logs for non development environments
pull/12289/head
maliming
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
6 additions and
24 deletions
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host.Mongo/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Host/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc.Mongo/Program.cs
-
templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/Program.cs
|
|
|
@ -18,12 +18,9 @@ public class Program |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Async(c => c.Console()); |
|
|
|
#else
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")); |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (IsMigrateDatabase(args)) |
|
|
|
{ |
|
|
|
loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); |
|
|
|
|
|
|
|
@ -24,12 +24,9 @@ public class Program |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Async(c => c.Console()); |
|
|
|
#else
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")); |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (IsMigrateDatabase(args)) |
|
|
|
{ |
|
|
|
loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); |
|
|
|
|
|
|
|
@ -17,12 +17,9 @@ public class Program |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Async(c => c.Console()); |
|
|
|
#else
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")); |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (IsMigrateDatabase(args)) |
|
|
|
{ |
|
|
|
loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); |
|
|
|
|
|
|
|
@ -23,12 +23,9 @@ public class Program |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Async(c => c.Console()); |
|
|
|
#else
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")); |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (IsMigrateDatabase(args)) |
|
|
|
{ |
|
|
|
loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); |
|
|
|
|
|
|
|
@ -18,12 +18,9 @@ public class Program |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Async(c => c.Console()); |
|
|
|
#else
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")); |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (IsMigrateDatabase(args)) |
|
|
|
{ |
|
|
|
loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); |
|
|
|
|
|
|
|
@ -24,12 +24,9 @@ public class Program |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Async(c => c.Console()); |
|
|
|
#else
|
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")); |
|
|
|
#endif
|
|
|
|
|
|
|
|
if (IsMigrateDatabase(args)) |
|
|
|
{ |
|
|
|
loggerConfiguration.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning); |
|
|
|
|