Last active
October 14, 2024 21:26
-
-
Save ithomas51/f6b4a00193d7a23943e26025f5fc97c4 to your computer and use it in GitHub Desktop.
serilog configuration file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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" | |
| ] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO:
{ "path": "/Logs/ConStrValidation-.txt", } // to { "path": "Logs/ConStrValidation-.txt", }