I'm using Serilog with ASP.NET Core 2.1. I want all log entries with a level of Information or higher to go to SQL Server and the console. I want only exceptions and higher to go to Email.
The Email sink is not being filtered and is also getting the same log entries as MSSQLServer and Console. It seems to be ignoring restrictedToMinimumlevel.
From my appsettings.json.
"Serilog": {
"MinimumLevel": "Information",
"WriteTo": [
{
"Name": "MSSqlServer",
"Args": {
"connectionString": "<removed>",
"tableName": "Logs"
}
},
{
"Name": "Console"
},
{
"Name": "Email",
"Args": {
"fromEmail": "<removed>",
"toEmail": "<removed>",
"mailServer": "<removed>",
"mailSubject": "Test",
"restrictedToMinimumlevel": "Error"
}
}
]
}
What am I doing wrong?
lat the start of what should beLevel. - serpent5