修改日志过滤
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-01-23 09:12:19 +08:00
parent aa08628b72
commit b74d46b425
1 changed files with 1 additions and 2 deletions

View File

@ -29,8 +29,7 @@ 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}")
.Filter.ByExcluding(logEvent => logEvent.Properties.ContainsKey("SourceContext") && logEvent.Properties["SourceContext"].ToString().Contains("health"));
outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {SourceContext:l} || {Message} || {Exception} ||end {NewLine}");
//.WriteTo.MSSqlServer("Data Source=DESKTOP-4TU9A6M;Initial Catalog=CoreFrame;User ID=sa;Password=123456", "logs", autoCreateSqlTable: true, restrictedToMinimumLevel: LogEventLevel.Information)//从左至右四个参数分别是数据库连接字符串、表名、如果表不存在是否创建、最低等级。Serilog会默认创建一些列。