To turn off HTTP request tracking in Serilog's appsettings.json, you need to update the configuration of the Serilog.AspNetCore package in the appsettings.json file. You can do this by adding the following line to the "Serilog" section of the appsettings.json file:
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "Console"
},
{
"Name": "File",
"Args": {
"path": "logs/log.json",
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
"Properties": {
"Application": "MyApplication"
},
"AspNetCore": {
"RequestLog": {
"LogLevel": {
"Default": "Warning",
"Microsoft": "Warning",
"Microsoft.AspNetCore.StaticFiles": "Warning"
}
}
}
}
In the "Serilog.AspNetCore" section, under "RequestLog", you can see the "LogLevel" field. Change the value of "Default" to a higher level than "Information". For example, you can set it to "Warning" to turn off HTTP request tracking.
"AspNetCore": {
"RequestLog": {
"LogLevel": {
"Default": "Warning",
"Microsoft": "Warning",
"Microsoft.AspNetCore.StaticFiles": "Warning"
}
}
}
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-06-20 21:34:48 +0000
Seen: 13 times
Last updated: Jun 20 '23
How can one ensure that sub-classes have uniform method parameters in TypeScript?
How can the calculation of matrix determinant be performed using CUDA?
How can code repetition be prevented when using (box)plot functions?
When I attempt to generate a database, why does the azure-cosmos-emulator become unresponsive?
What steps can I take to prevent my webpage from slowing down when all parts of a div are displayed?