This commit is contained in:
2026-11-08 17:59:09 +03:30
parent 8bbd05d2c0
commit c711cae78f
3 changed files with 52 additions and 15 deletions
+13 -2
View File
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
using xApi.Extensions; using xApi.Extensions;
using xHttpService.DI; using xHttpService.DI;
using System.Reflection; using System.Reflection;
using xLoggingService.DI;
using xCommons.Extensions; using xCommons.Extensions;
using xDataService.Models; using xDataService.Models;
using xIdentityService.DI; using xIdentityService.DI;
@@ -41,6 +42,7 @@ 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);
@@ -119,7 +121,10 @@ namespace xApi
); );
} }
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) public void Configure(
IApplicationBuilder app,
IWebHostEnvironment env
)
{ {
// //
if (env.IsDevelopment()) if (env.IsDevelopment())
@@ -127,6 +132,10 @@ namespace xApi
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
//
// Setting Environment in App Confiuration ...
app.AddEnvironmentToXAppConfiguration(env.EnvironmentName);
// //
// Use Swagger Middleware ... // Use Swagger Middleware ...
app.UseXSwagger(); app.UseXSwagger();
@@ -169,4 +178,6 @@ namespace xApi
); );
} }
} }
} }
+35 -1
View File
@@ -185,7 +185,41 @@
"Default": "Information", "Default": "Information",
"Microsoft": "Warning", "Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information" "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": "*" "AllowedHosts": "*"
} }
+4 -12
View File
@@ -7,47 +7,37 @@
<PackageId>xSaherElm.xApi</PackageId> <PackageId>xSaherElm.xApi</PackageId>
<Company>SaherElm IT Center</Company> <Company>SaherElm IT Center</Company>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<Description> <Description>
a WebAPI Project which contains all Business Logic of xSaherElm Project. a WebAPI Project which contains all Business Logic of xSaherElm Project.
</Description> </Description>
<!-- Icon Definition --> <!-- Icon Definition -->
<PackageIcon>icon.png</PackageIcon> <PackageIcon>icon.png</PackageIcon>
<!-- Fix Duplicate TargetFramework Issue --> <!-- Fix Duplicate TargetFramework Issue -->
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup> </PropertyGroup>
<!-- Icon Handling --> <!-- Icon Handling -->
<ItemGroup> <ItemGroup>
<None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true" <None Include="../../Resources/Images/favicon.png" Link="icon.png" Pack="true" PackagePath="\icon.png" />
PackagePath="\icon.png" />
</ItemGroup> </ItemGroup>
<!-- Local Dependencies --> <!-- Local Dependencies -->
<!-- Local Projects --> <!-- Local Projects -->
<ItemGroup> <ItemGroup>
<!-- All Modules Has Dependencies in xService --> <!-- All Modules Has Dependencies in xService -->
<ProjectReference Include="..\Modules\xServices\xServices.csproj" /> <ProjectReference Include="..\Modules\xServices\xServices.csproj" />
</ItemGroup> </ItemGroup>
<!-- Dependencies --> <!-- Dependencies -->
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.11" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.11" />
<PackageReference Include="IdentityModel.AspNetCore.OAuth2Introspection" Version="5.0.0" /> <PackageReference Include="IdentityModel.AspNetCore.OAuth2Introspection" Version="5.0.0" />
</ItemGroup> </ItemGroup>
<!-- For XML Documentation Support --> <!-- For XML Documentation Support -->
<PropertyGroup> <PropertyGroup>
<NoWarn>$(NoWarn);1591</NoWarn> <NoWarn>$(NoWarn);1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup> </PropertyGroup>
<!-- Ef Core --> <!-- Ef Core -->
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
@@ -55,9 +45,11 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<!-- Create Required Folders --> <!-- Create Required Folders -->
<Target Name="CreateRequiredFolder" AfterTargets="AfterPublish"> <Target Name="CreateRequiredFolder" AfterTargets="AfterPublish">
<MakeDir Directories="$(PublishDir)wwwroot" Condition="!Exists('$(PublishDir)wwwroot')" /> <MakeDir Directories="$(PublishDir)wwwroot" Condition="!Exists('$(PublishDir)wwwroot')" />
</Target> </Target>
<ItemGroup>
<ProjectReference Include="..\Modules\xLoggingService\xLoggingService.csproj" />
</ItemGroup>
</Project> </Project>