Skip to content

Instantly share code, notes, and snippets.

@ithomas51
Last active October 14, 2024 21:26
Show Gist options
  • Save ithomas51/f6b4a00193d7a23943e26025f5fc97c4 to your computer and use it in GitHub Desktop.
Save ithomas51/f6b4a00193d7a23943e26025f5fc97c4 to your computer and use it in GitHub Desktop.

Revisions

  1. ithomas51 revised this gist Jun 13, 2023. No changes.
  2. ithomas51 revised this gist Jun 13, 2023. 1 changed file with 54 additions and 1 deletion.
    55 changes: 54 additions & 1 deletion appsettings.Development.Serilog.json
    Original file line number Diff line number Diff line change
    @@ -1 +1,54 @@
    ‎‎​
    {
    "Serilog": {
    "Using": [
    "Serilog.Sinks.Console",
    "Serilog.Sinks.File",
    "Serilog.Sinks.Async"
    ],
    "MinimumLevel": {
    "Default": "Information",
    "Override": {
    "Default": "Information",
    "Microsoft.AspNetCore": "Warning",
    "Microsoft.Hosting": "Information",
    "Microsoft.EntityFrameworkCore": "Warning",
    "Microsoft.EntityFrameworkCore.Database.Command": "Warning"
    }
    },
    "WriteTo:Console": {
    "Name": "Console",
    "Args": {
    "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] >>> {Message} -- {RequestId}{NewLine}{Exception}",
    "formatter": "Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact"
    },
    "Enrich": [
    "FromLogContext",
    "WithMachineName",
    "WithProcessId",
    "WithThreadId"
    ]
    },
    "WriteTo:Async": {
    "Name": "Async",
    "Args": {
    "configure": [
    {
    "Name": "File",
    "Args": {
    "path": "/Logs/ConStrValidation-.txt",
    "rollingInterval": "Day",
    "rollOnFileSizeLimit": true,
    "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Properties:j} {NewLine} >>> {Message:lj} {NewLine}{Exception}"
    }
    }
    ]
    },
    "Enrich": [
    "FromLogContext",
    "WithMachineName",
    "WithProcessId",
    "WithThreadId"
    ]
    }
    }
    }
  3. ithomas51 created this gist Jun 13, 2023.
    1 change: 1 addition & 0 deletions appsettings.Development.Serilog.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​