2 years ago

#64751

test-img

Always learning

Serilog: How do I remove unnecessary information Net core 6

I'm using ASP net core 6 and I don't have the startup class. Of course, I programmed the whole thing in Visual studio code 2022

The problem: enter image description here

I don't want the location to be shown in the console. You can see Below AppSettings.Json

 "AllowedHosts": "*",
 "Serilog": {
"Using": [],
"MinimunLevel": {
  "Default": "Information",
  "Overrite": {
    "Microsoft": "Warning",
    "System": "Warning"
  }
},
"Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ],
"WriteTo": [
  { "Name": "Console" },
  {
    "Name": "File",
    "Args": {
      "path": "C:\\Demos\\Logs\\Log.txt"
    }

Otherwise, all the other information I need is shown and it works, only I don't want the location to be shown

c#

json

serilog

0 Answers

Your Answer

Accepted video resources