Browse Source
Merge pull request #5366 from abpframework/maliming/console-log
Write log to console when Debug.
pull/5416/head
Halil İbrahim Kalkan
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with
39 additions and
16 deletions
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/MyCompanyName.MyProjectName.DbMigrator.csproj
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/Program.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/MyCompanyName.MyProjectName.HttpApi.HostWithIds.csproj
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/Program.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/Program.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/Program.cs
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/MyCompanyName.MyProjectName.Web.csproj
-
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web/Program.cs
-
templates/console/src/MyCompanyName.MyProjectName/Program.cs
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyCompanyName.MyProjectName.HttpApi.Host.csproj
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/Program.cs
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyCompanyName.MyProjectName.IdentityServer.csproj
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/Program.cs
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyCompanyName.MyProjectName.Web.Host.csproj
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/Program.cs
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyCompanyName.MyProjectName.Web.Unified.csproj
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/Program.cs
|
|
|
@ -20,6 +20,7 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" /> |
|
|
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -22,8 +22,8 @@ namespace MyCompanyName.MyProjectName.DbMigrator |
|
|
|
.MinimumLevel.Override("MyCompanyName.MyProjectName", LogEventLevel.Information) |
|
|
|
#endif
|
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.File(Path.Combine(Directory.GetCurrentDirectory(), "Logs/logs.txt")) |
|
|
|
.WriteTo.Console() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
await CreateHostBuilder(args).RunConsoleAsync(); |
|
|
|
|
|
|
|
@ -11,7 +11,6 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -19,6 +19,9 @@ namespace MyCompanyName.MyProjectName |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -11,7 +11,6 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -19,6 +19,9 @@ namespace MyCompanyName.MyProjectName |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -33,7 +33,6 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.6" /> |
|
|
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -19,6 +19,9 @@ namespace MyCompanyName.MyProjectName |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -17,7 +17,6 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -20,6 +20,9 @@ namespace MyCompanyName.MyProjectName.Web |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -33,7 +33,6 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -20,6 +20,9 @@ namespace MyCompanyName.MyProjectName.Web |
|
|
|
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -21,7 +21,7 @@ namespace MyCompanyName.MyProjectName |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
.WriteTo.Console() |
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="IdentityModel" Version="4.3.1" /> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -19,7 +19,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
#endif
|
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.File("Logs/logs.txt") |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.6" /> |
|
|
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -19,7 +19,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
#endif
|
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.File("Logs/logs.txt") |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.6" /> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="3.1.6" /> |
|
|
|
|
|
|
|
@ -19,7 +19,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
#endif
|
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.File("Logs/logs.txt") |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> |
|
|
|
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> |
|
|
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.5.1" /> |
|
|
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6" /> |
|
|
|
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" /> |
|
|
|
|
|
|
|
@ -15,7 +15,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
.MinimumLevel.Debug() |
|
|
|
.MinimumLevel.Override("Microsoft", LogEventLevel.Information) |
|
|
|
.Enrich.FromLogContext() |
|
|
|
.WriteTo.File("Logs/logs.txt") |
|
|
|
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|
|
|
#if DEBUG
|
|
|
|
.WriteTo.Async(c => c.Console()) |
|
|
|
#endif
|
|
|
|
.CreateLogger(); |
|
|
|
|
|
|
|
try |
|
|
|
|