我有以下代码,它们成功地只记录了排除Microsoft和其他系统的信息日志,但是控制台仍然会收到一些我想要排除的信息
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": { "outputTemplate": "[{Timestamp:HH:mm:ss.fff}] {Level:u3} - {Message}{NewLine}{Exception}" }
},
{
"Name": "RollingFile",
"Args": {
"pathFormat": "log-{Date}.log",
"outputTemplate": "[{Timestamp:dd/MM/yy HH:mm:ss.fff z}] {Level:u3} {Message}{NewLine}{Exception}"
}
}
]
},
此处还有写入控制台但不是基于上述设置的滚动文件
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 2.0.1-rtm-125 initialized 'CryptoAlertContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None
info: Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (26ms) [Parameters=[@__p_0='?'], CommandType='Text', CommandTimeout='30']
SELECT TOP(@__p_0) [x].[CoinId], [x].[Icon], [x].[LastPriceBtc], [x].[LastPriceUsd], [x].[LastUpdated], [x].[Name], [x].[Rank], [x].[Symbol]
FROM [Coins] AS [x]
ORDER BY [x].[Rank]