add using XLoggingService ...

This commit is contained in:
2026-11-08 22:55:35 +03:30
parent c711cae78f
commit 18eb5d92e1
3 changed files with 39 additions and 40 deletions
+1
View File
@@ -1,6 +1,7 @@
#
bin
obj
Logs
#
Db/*
+5 -2
View File
@@ -42,7 +42,6 @@ namespace xApi
public void ConfigureServices(IServiceCollection services)
{
services.AddXLoggingService(Configuration);
//
// Register Validation Provider and all XCommons Module Services ...
services.AddXCommons(Configuration);
@@ -52,6 +51,10 @@ namespace xApi
services.AddXAppConfiguration(Configuration);
var appConfiguration = services.GetRegisteredService<XAppConfiguration>();
//
// Register Logging Service ...
services.AddXLoggingService(Configuration);
//
// Register Allowed Origins ...
services.AddXCors(appConfiguration.AllowedOrigins);
@@ -122,7 +125,7 @@ namespace xApi
}
public void Configure(
IApplicationBuilder app,
IApplicationBuilder app,
IWebHostEnvironment env
)
{
+33 -38
View File
@@ -4,10 +4,7 @@
"DefaultLanguage": "fa-IR",
"XPoweredValue": "SaherElmITCenter",
"WelcomeMessage": "Welcome to xSaherElm Project's API",
"AllowedOrigins": [
"http://saherelm.ir",
"https://saherelm.ir"
],
"AllowedOrigins": ["http://saherelm.ir", "https://saherelm.ir"],
"SwaggerConfiguration": {
"Version": "v1.0",
"Title": "xSaherElm API",
@@ -180,45 +177,43 @@
"XPoweredValue": "SaherElmITCenter",
"DefaultClientTimeout": -1
},
"LoggingServiceConfiguration": {
"Enabled": true,
"MinimumLevel": "Information",
"Queue": {
"Enabled": true,
"Capacity": 10000,
"ShutdownTimeoutSeconds": 10
},
"File": {
"Enabled": true,
"Format": "Json",
"Directory": "./Logs",
"FileName": "xApi-.log",
"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": "xApi",
"MinimumLevel": "Error",
"Topic": "application-logs",
"Action": "ApplicationLogCreated"
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
},
"XLogger": {
"Enabled": true,
"ApplicationName": "xApi",
"EnvironmentName": "Production",
"MinimumLevel": "Information",
"Queue": {
"Enabled": true,
"Capacity": 10000,
"ShutdownTimeoutSeconds": 10
},
"File": {
"Enabled": true,
"Directory": "./Logs",
"FileName": "xApi-.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": "xApi",
"MinimumLevel": "Error"
}
}
},
"AllowedHosts": "*"