diff --git a/Startup.cs b/Startup.cs index 8744878..f28c614 100644 --- a/Startup.cs +++ b/Startup.cs @@ -1,4 +1,3 @@ -using xLoggingService.DI; using System; using System.IO; using xAiApi.DI; @@ -16,6 +15,7 @@ using Newtonsoft.Json; using System.Reflection; using xAiApi.Extensions; using xStringService.DI; +using xLoggingService.DI; using xStorageService.DI; using xIdentityService.DI; using xDataService.Models; @@ -62,7 +62,6 @@ namespace xAiApi public void ConfigureServices(IServiceCollection services) { - services.AddXLoggingService(Configuration); // // Register Validation Provider and all XCommons Module Services ... services.AddXCommons(Configuration); @@ -72,6 +71,10 @@ namespace xAiApi services.AddXAppConfiguration(Configuration); var appConfiguration = services.GetRegisteredService(); + // + // Register Logging Service ... + services.AddXLoggingService(Configuration); + // // Register Allowed Origins ... services.AddXCors(appConfiguration.AllowedOrigins); diff --git a/appsettings.json b/appsettings.json index af3c6fe..b69de1c 100644 --- a/appsettings.json +++ b/appsettings.json @@ -51,44 +51,42 @@ "BaseRoute": "hubs", "AddSupportMessageProtocol": true }, + "LoggingServiceConfiguration": { + "Enabled": true, + "MinimumLevel": "Information", + "Queue": { + "Enabled": true, + "Capacity": 10000, + "ShutdownTimeoutSeconds": 10 + }, + "File": { + "Enabled": true, + "Directory": "./Logs", + "FileName": "xAiApi-.log", + "Format": "Json", + "MinimumLevel": "Information", + "RetainedFileCountLimit": 30 + }, + "Database": { + "Enabled": false, + "TableName": "XLogs", + "AutoCreateTable": true, + "MinimumLevel": "Warning", + "Provider": "Microsoft.Data.Sqlite", + "ConnectionString": "Filename=./Db/XLogs.db" + }, + "Event": { + "Enabled": false, + "Sender": "xAiApi", + "MinimumLevel": "Error", + "Topic": "application-logs", + "Action": "ApplicationLogCreated" + } + }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" - }, - "XLogger": { - "Enabled": true, - "ApplicationName": "xAiApi", - "EnvironmentName": "Production", - "MinimumLevel": "Information", - "Queue": { - "Enabled": true, - "Capacity": 10000, - "ShutdownTimeoutSeconds": 10 - }, - "File": { - "Enabled": true, - "Directory": "./Logs", - "FileName": "xAiApi-.log", - "Format": "Json", - "MinimumLevel": "Information", - "RetainedFileCountLimit": 30 - }, - "Database": { - "Enabled": false, - "Provider": "Microsoft.Data.Sqlite", - "ConnectionString": "Filename=./Db/XLogs.db", - "TableName": "XLogs", - "AutoCreateTable": true, - "MinimumLevel": "Warning" - }, - "Event": { - "Enabled": false, - "Topic": "application-logs", - "Action": "ApplicationLogCreated", - "Sender": "xAiApi", - "MinimumLevel": "Error" - } } }, "AllowedHosts": "*"