From e78ea01cb5c76cc8e7934324e9ba0598853a795d Mon Sep 17 00:00:00 2001 From: CWX Date: Wed, 23 Apr 2025 10:17:21 +0100 Subject: [PATCH] update appsettings to use async --- SPTarkov.Server/appsettings.Development.json | 220 ++++++++++--------- SPTarkov.Server/appsettings.json | 127 ++++++----- 2 files changed, 181 insertions(+), 166 deletions(-) diff --git a/SPTarkov.Server/appsettings.Development.json b/SPTarkov.Server/appsettings.Development.json index 17203199..aae73636 100644 --- a/SPTarkov.Server/appsettings.Development.json +++ b/SPTarkov.Server/appsettings.Development.json @@ -1,120 +1,128 @@ { - "Serilog": { - "Using": [ - "Serilog.Sinks.Console", - "Serilog.Sinks.File", - "Serilog.Sinks.Async", - "Serilog.Settings.Configuration", - "Serilog.Expressions", - "Serilog.Exceptions", - "Serilog.Enrichers.Context", - "Serilog.Enrichers.Thread" - ], - "MinimumLevel": { - "Default": "Verbose", - "Override": { - "Microsoft": "Verbose" - } - }, - "WriteTo": [ + "Serilog": { + "Using": [ + "Serilog.Sinks.Console", + "Serilog.Sinks.File", + "Serilog.Sinks.Async", + "Serilog.Settings.Configuration", + "Serilog.Expressions", + "Serilog.Exceptions", + "Serilog.Enrichers.Context", + "Serilog.Enrichers.Thread", + "Serilog.Debugging.SelfLog" + ], + "MinimumLevel": { + "Default": "Verbose", + "Override": { + "Microsoft": "Verbose" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ { - "Name": "Logger", - "Args": { - "configureLogger": { - "Filter": [ - { - "Name": "ByExcluding", - "Args": { - "expression": "StartsWith(SourceContext, 'SPTarkov.Server.Core.Servers.Http.RequestLogger')" - } - }, - { - "Name": "ByExcluding", - "Args": { - "expression": "SourceContext like 'Microsoft%'" - } - } - ], - "WriteTo": [ - { - "Name": "Console", - "Args": { - "formatter": "SPTarkov.Server.Logger.ConsoleFormatter::Default, SPTarkov.Server" - } - }, - { - "Name": "File", - "Args": { - "path": "./user/logs/spt/spt.txt", - "rollingInterval": "Day", - "fileSizeLimitBytes": "20971520", - "rollOnFileSizeLimit": true, - "formatter": "SPTarkov.Server.Logger.FileFormatter::Default, SPTarkov.Server" - } - } - ] + "Name": "Logger", + "Args": { + "configureLogger": { + "Filter": [ + { + "Name": "ByExcluding", + "Args": { + "expression": "StartsWith(SourceContext, 'SPTarkov.Server.Core.Servers.Http.RequestLogger')" + } + }, + { + "Name": "ByExcluding", + "Args": { + "expression": "SourceContext like 'Microsoft%'" + } } + ], + "WriteTo": [ + { + "Name": "Console", + "Args": { + "formatter": "SPTarkov.Server.Logger.ConsoleFormatter::Default, SPTarkov.Server" + } + }, + { + "Name": "File", + "Args": { + "path": "./user/logs/spt/spt.txt", + "rollingInterval": "Day", + "fileSizeLimitBytes": "20971520", + "rollOnFileSizeLimit": true, + "formatter": "SPTarkov.Server.Logger.FileFormatter::Default, SPTarkov.Server" + } + } + ] } + } }, { - "Name": "Logger", - "Args": { - "configureLogger": { - "Filter": [ - { - "Name": "ByIncludingOnly", - "Args": { - "expression": "StartsWith(SourceContext, 'SPTarkov.Server.Core.Servers.Http.RequestLogger')" - } - } - ], - "WriteTo": [ - { - "Name": "File", - "Args": { - "formatter": "SPTarkov.Server.Logger.FileFormatter::Default, SPTarkov.Server", - "path": "./user/logs/requests/requests.txt", - "rollingInterval": "Day", - "fileSizeLimitBytes": "20971520", - "rollOnFileSizeLimit": true - } - } - ] + "Name": "Logger", + "Args": { + "configureLogger": { + "Filter": [ + { + "Name": "ByIncludingOnly", + "Args": { + "expression": "StartsWith(SourceContext, 'SPTarkov.Server.Core.Servers.Http.RequestLogger')" + } } + ], + "WriteTo": [ + { + "Name": "File", + "Args": { + "formatter": "SPTarkov.Server.Logger.FileFormatter::Default, SPTarkov.Server", + "path": "./user/logs/requests/requests.txt", + "rollingInterval": "Day", + "fileSizeLimitBytes": "20971520", + "rollOnFileSizeLimit": true + } + } + ] } + } }, { - "Name": "Logger", - "Args": { - "configureLogger": { - "Filter": [ - { - "Name": "ByIncludingOnly", - "Args": { - "expression": "SourceContext like 'Microsoft%'" - } - } - ], - "WriteTo": [ - { - "Name": "File", - "Args": { - "path": "./user/logs/kestrel/kestrel.txt", - "rollingInterval": "Day", - "fileSizeLimitBytes": "20971520", - "rollOnFileSizeLimit": true, - "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}" - } - } - ] + "Name": "Logger", + "Args": { + "configureLogger": { + "Filter": [ + { + "Name": "ByIncludingOnly", + "Args": { + "expression": "SourceContext like 'Microsoft%'" + } } + ], + "WriteTo": [ + { + "Name": "File", + "Args": { + "path": "./user/logs/kestrel/kestrel.txt", + "rollingInterval": "Day", + "fileSizeLimitBytes": "20971520", + "rollOnFileSizeLimit": true, + "outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}" + } + } + ] } + } } - ], - "Enrich": [ - "FromLogContext", - "WithExceptionDetails", - "WithThreadId" - ] - } + ] + } + } + ], + "Enrich": [ + "FromLogContext", + "WithExceptionDetails", + "WithThreadId" + ] + } } diff --git a/SPTarkov.Server/appsettings.json b/SPTarkov.Server/appsettings.json index 27d51757..f1c901a8 100644 --- a/SPTarkov.Server/appsettings.json +++ b/SPTarkov.Server/appsettings.json @@ -1,66 +1,73 @@ { - "Serilog": { - "Using": [ - "Serilog.Sinks.Console", - "Serilog.Sinks.File", - "Serilog.Sinks.Async", - "Serilog.Settings.Configuration", - "Serilog.Expressions", - "Serilog.Exceptions", - "Serilog.Enrichers.Context", - "Serilog.Enrichers.Thread" - ], - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Information" - } - }, - "WriteTo": [ + "Serilog": { + "Using": [ + "Serilog.Sinks.Console", + "Serilog.Sinks.File", + "Serilog.Sinks.Async", + "Serilog.Settings.Configuration", + "Serilog.Expressions", + "Serilog.Exceptions", + "Serilog.Enrichers.Context", + "Serilog.Enrichers.Thread" + ], + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Information" + } + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ { - "Name": "Logger", - "Args": { - "configureLogger": { - "Filter": [ - { - "Name": "ByExcluding", - "Args": { - "expression": "StartsWith(SourceContext, 'SPTarkov.Server.Core.Servers.Http.RequestLogger')" - } - }, - { - "Name": "ByExcluding", - "Args": { - "expression": "SourceContext like 'Microsoft%'" - } - } - ], - "WriteTo": [ - { - "Name": "Console", - "Args": { - "formatter": "SPTarkov.Server.Logger.ConsoleFormatter::Default, SPTarkov.Server" - } - }, - { - "Name": "File", - "Args": { - "path": "./user/logs/spt/spt.txt", - "rollingInterval": "Day", - "fileSizeLimitBytes": "20971520", - "rollOnFileSizeLimit": true, - "formatter": "SPTarkov.Server.Logger.FileFormatter::Default, SPTarkov.Server" - } - } - ] + "Name": "Logger", + "Args": { + "configureLogger": { + "Filter": [ + { + "Name": "ByExcluding", + "Args": { + "expression": "StartsWith(SourceContext, 'SPTarkov.Server.Core.Servers.Http.RequestLogger')" + } + }, + { + "Name": "ByExcluding", + "Args": { + "expression": "SourceContext like 'Microsoft%'" + } } + ], + "WriteTo": [ + { + "Name": "Console", + "Args": { + "formatter": "SPTarkov.Server.Logger.ConsoleFormatter::Default, SPTarkov.Server" + } + }, + { + "Name": "File", + "Args": { + "path": "./user/logs/spt/spt.txt", + "rollingInterval": "Day", + "fileSizeLimitBytes": "20971520", + "rollOnFileSizeLimit": true, + "formatter": "SPTarkov.Server.Logger.FileFormatter::Default, SPTarkov.Server" + } + } + ] } + } } - ], - "Enrich": [ - "FromLogContext", - "WithExceptionDetails", - "WithThreadId" - ] - } + ] + } + } + ], + "Enrich": [ + "FromLogContext", + "WithExceptionDetails", + "WithThreadId" + ] + } }