Compare commits

...
1 Commits
Author SHA1 Message Date
saherelm 18eb5d92e1 add using XLoggingService ... 2026-11-08 22:55:35 +03:30
3 changed files with 39 additions and 40 deletions
+1
View File
@@ -1,6 +1,7 @@
# #
bin bin
obj obj
Logs
# #
Db/* Db/*
+4 -1
View File
@@ -42,7 +42,6 @@ namespace xApi
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddXLoggingService(Configuration);
// //
// Register Validation Provider and all XCommons Module Services ... // Register Validation Provider and all XCommons Module Services ...
services.AddXCommons(Configuration); services.AddXCommons(Configuration);
@@ -52,6 +51,10 @@ namespace xApi
services.AddXAppConfiguration(Configuration); services.AddXAppConfiguration(Configuration);
var appConfiguration = services.GetRegisteredService<XAppConfiguration>(); var appConfiguration = services.GetRegisteredService<XAppConfiguration>();
//
// Register Logging Service ...
services.AddXLoggingService(Configuration);
// //
// Register Allowed Origins ... // Register Allowed Origins ...
services.AddXCors(appConfiguration.AllowedOrigins); services.AddXCors(appConfiguration.AllowedOrigins);
+15 -20
View File
@@ -4,10 +4,7 @@
"DefaultLanguage": "fa-IR", "DefaultLanguage": "fa-IR",
"XPoweredValue": "SaherElmITCenter", "XPoweredValue": "SaherElmITCenter",
"WelcomeMessage": "Welcome to xSaherElm Project's API", "WelcomeMessage": "Welcome to xSaherElm Project's API",
"AllowedOrigins": [ "AllowedOrigins": ["http://saherelm.ir", "https://saherelm.ir"],
"http://saherelm.ir",
"https://saherelm.ir"
],
"SwaggerConfiguration": { "SwaggerConfiguration": {
"Version": "v1.0", "Version": "v1.0",
"Title": "xSaherElm API", "Title": "xSaherElm API",
@@ -180,16 +177,8 @@
"XPoweredValue": "SaherElmITCenter", "XPoweredValue": "SaherElmITCenter",
"DefaultClientTimeout": -1 "DefaultClientTimeout": -1
}, },
"Logging": { "LoggingServiceConfiguration": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
},
"XLogger": {
"Enabled": true, "Enabled": true,
"ApplicationName": "xApi",
"EnvironmentName": "Production",
"MinimumLevel": "Information", "MinimumLevel": "Information",
"Queue": { "Queue": {
"Enabled": true, "Enabled": true,
@@ -198,27 +187,33 @@
}, },
"File": { "File": {
"Enabled": true, "Enabled": true,
"Format": "Json",
"Directory": "./Logs", "Directory": "./Logs",
"FileName": "xApi-.log", "FileName": "xApi-.log",
"Format": "Json",
"MinimumLevel": "Information", "MinimumLevel": "Information",
"RetainedFileCountLimit": 30 "RetainedFileCountLimit": 30
}, },
"Database": { "Database": {
"Enabled": false, "Enabled": false,
"Provider": "Microsoft.Data.Sqlite",
"ConnectionString": "Filename=./Db/XLogs.db",
"TableName": "XLogs", "TableName": "XLogs",
"AutoCreateTable": true, "AutoCreateTable": true,
"MinimumLevel": "Warning" "MinimumLevel": "Warning",
"Provider": "Microsoft.Data.Sqlite",
"ConnectionString": "Filename=./Db/XLogs.db"
}, },
"Event": { "Event": {
"Enabled": false, "Enabled": false,
"Topic": "application-logs",
"Action": "ApplicationLogCreated",
"Sender": "xApi", "Sender": "xApi",
"MinimumLevel": "Error" "MinimumLevel": "Error",
"Topic": "application-logs",
"Action": "ApplicationLogCreated"
} }
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*"