From 5656ec07d50eab8996a727a193b4a299388fcfb3 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Mon, 9 Nov 2026 12:50:22 +0330 Subject: [PATCH] =?UTF-8?q?-=20.gitignore:=20+Logs=20-=20Program.cs:=20+xL?= =?UTF-8?q?oggingService=D8=8C=20+AddXTelemetryLogger=D8=8C=20+AddXTelemet?= =?UTF-8?q?ry=20-=20Startup.cs:=20+UseXRequestLogger=20(non-development)?= =?UTF-8?q?=20-=20xAiApi.csproj:=20+xLoggingService=20reference?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Program.cs | 6 +++++- Startup.cs | 7 +++++++ xAiApi.csproj | 18 ++++++++++++++---- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8490832..95a3056 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # bin/* obj/* +Logs # Db/* diff --git a/Program.cs b/Program.cs index f2b8c93..13cb52a 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,5 @@ using System.Text; +using xLoggingService.DI; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; @@ -19,10 +20,13 @@ namespace xAiApi { // var result = Host.CreateDefaultBuilder(args) + .ConfigureLogging(logging => + logging.AddXTelemetryLogger()) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); - }); + }) + .AddXTelemetry(); // return result; diff --git a/Startup.cs b/Startup.cs index f28c614..f8a559e 100644 --- a/Startup.cs +++ b/Startup.cs @@ -271,6 +271,13 @@ namespace xAiApi // Using Routing ... app.UseRouting(); + // + // Using Request Logging ... + if (!isDevelopmentEnvironment) + { + app.UseXRequestLogger(); + } + // // Use xIdentityService (Authentication) ... app.UseXIdentityService(); diff --git a/xAiApi.csproj b/xAiApi.csproj index 27964e6..f51c8ce 100644 --- a/xAiApi.csproj +++ b/xAiApi.csproj @@ -1,4 +1,5 @@ + 1.0.0 @@ -7,22 +8,28 @@ SaherElm IT Center xSaherElm.xAiApi netcoreapp3.1 + a WebAPI Project which contains all Business Logic of xSaherElm Project's AI. + icon.png + - false false + false + + + @@ -33,8 +40,10 @@ + + @@ -58,12 +67,14 @@ + $(NoWarn);1591 true true + @@ -71,11 +82,10 @@ all + - - - + \ No newline at end of file