[屏蔽健康检查 测试2]
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-01-22 17:18:12 +08:00
parent 152846cfd5
commit d4b2c48916
1 changed files with 3 additions and 3 deletions

View File

@ -19,8 +19,7 @@ namespace IRaCIS.Core.API
// Filter out ASP.NET Core infrastructre logs that are Information and below 日志太多了 一个请求 记录好几条
.MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning)
.MinimumLevel.Override("Hangfire", LogEventLevel.Warning)
.MinimumLevel.Override("System.Net.Http.HttpClient.HttpReports", LogEventLevel.Warning)
.Filter.ByExcluding(logEvent =>logEvent.Properties["SourceContext"].ToString().Contains("health"))
.MinimumLevel.Override("System.Net.Http.HttpClient.HttpReports", LogEventLevel.Warning)
.Enrich.WithClientIp()
.Enrich.FromLogContext()
@ -30,7 +29,8 @@ namespace IRaCIS.Core.API
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}")
.WriteTo.File($"{AppContext.BaseDirectory}Serilogs/.log", rollingInterval: RollingInterval.Day,
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}");
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}")
.Filter.ByExcluding(logEvent => logEvent.Properties.ContainsKey("SourceContext") && logEvent.Properties["SourceContext"].ToString().Contains("health"));
//.WriteTo.MSSqlServer("Data Source=DESKTOP-4TU9A6M;Initial Catalog=CoreFrame;User ID=sa;Password=123456", "logs", autoCreateSqlTable: true, restrictedToMinimumLevel: LogEventLevel.Information)//从左至右四个参数分别是数据库连接字符串、表名、如果表不存在是否创建、最低等级。Serilog会默认创建一些列。