From cbc260a1d79e9c6293628040926c4e0135614ea3 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Fri, 24 Dec 2021 00:59:15 +0800 Subject: [PATCH] feat(logging): add distributed id to logging property --- ...LocalizationManagement.HttpApi.Host.csproj | 1 + ...LocalizationManagementHttpApiHostModule.cs | 2 + .../appsettings.json | 2 +- ...ice.PlatformManagement.HttpApi.Host.csproj | 1 + .../PlatformManagementHttpApiHostModule.cs | 72 ++++++++++--------- .../appsettings.json | 2 +- ...ervice.RealtimeMessage.HttpApi.Host.csproj | 1 + .../RealtimeMessageHttpApiHostModule.cs | 2 + .../appsettings.json | 2 +- ...ice.WorkflowManagement.HttpApi.Host.csproj | 1 + .../WorkflowManagementHttpApiHostModule.cs | 62 ++++++++-------- .../appsettings.json | 2 +- .../IdentityServerHttpApiHostModule.cs | 56 ++++++++------- ...Service.identityServer.HttpApi.Host.csproj | 1 + .../appsettings.json | 2 +- .../IdentityServerModule.cs | 58 +++++++-------- .../LY.MicroService.IdentityServer.csproj | 1 + .../appsettings.json | 2 +- 18 files changed, 144 insertions(+), 126 deletions(-) diff --git a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj index 006beb283..8c511656f 100644 --- a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj @@ -43,6 +43,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs index ca8746d48..87fb2f456 100644 --- a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs @@ -8,6 +8,7 @@ using LINGYUN.Abp.LocalizationManagement; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.MultiTenancy.DbFinder; using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -27,6 +28,7 @@ namespace LY.MicroService.LocalizationManagement { [DependsOn( typeof(AbpSerilogEnrichersApplicationModule), + typeof(AbpSerilogEnrichersUniqueIdModule), typeof(AbpAspNetCoreSerilogModule), typeof(AbpAuditLoggingElasticsearchModule), typeof(AbpAspNetCoreMultiTenancyModule), diff --git a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json index 28721ef2f..7d29039dd 100644 --- a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json @@ -15,7 +15,7 @@ "DotNetCore": "Information" } }, - "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName" ], + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], "WriteTo": [ { "Name": "Console", diff --git a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj index b5a52dac5..ecbd725a0 100644 --- a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj @@ -50,6 +50,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs index d24c943ad..2be103608 100644 --- a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs @@ -13,6 +13,7 @@ using LINGYUN.Abp.OssManagement.FileSystem; using LINGYUN.Abp.OssManagement.FileSystem.ImageSharp; using LINGYUN.Abp.OssManagement.SettingManagement; using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.UI.Navigation.VueVbenAdmin; using LINGYUN.Platform; using LINGYUN.Platform.EntityFrameworkCore; @@ -39,41 +40,42 @@ using Volo.Abp.TenantManagement.EntityFrameworkCore; namespace LY.MicroService.PlatformManagement; [DependsOn( - typeof(AbpSerilogEnrichersApplicationModule), - typeof(AbpAspNetCoreSerilogModule), - typeof(AbpAuditLoggingElasticsearchModule), - typeof(AbpAspNetCoreMultiTenancyModule), - typeof(AbpUINavigationVueVbenAdminModule), - // typeof(AbpOssManagementAliyunModule), - typeof(AbpOssManagementFileSystemModule), // 本地文件系统提供者模块 - typeof(AbpOssManagementFileSystemImageSharpModule), // 本地文件系统图形处理模块 - typeof(AbpOssManagementApplicationModule), - typeof(AbpOssManagementHttpApiModule), - typeof(AbpOssManagementSettingManagementModule), - typeof(PlatformApplicationModule), - typeof(PlatformHttpApiModule), - typeof(PlatformEntityFrameworkCoreModule), - typeof(AbpIdentityHttpApiClientModule), - typeof(AbpHttpClientIdentityModelWebModule), - typeof(AbpFeatureManagementEntityFrameworkCoreModule), - typeof(AbpTenantManagementEntityFrameworkCoreModule), - typeof(AbpSettingManagementEntityFrameworkCoreModule), - typeof(AbpPermissionManagementEntityFrameworkCoreModule), - typeof(AbpLocalizationManagementEntityFrameworkCoreModule), - typeof(AbpDataDbMigratorModule), - typeof(AbpAspNetCoreAuthenticationJwtBearerModule), - typeof(AbpNotificationModule), - typeof(AbpEmailingExceptionHandlingModule), - typeof(AbpCAPEventBusModule), - typeof(AbpFeaturesValidationRedisModule), - // typeof(AbpFeaturesClientModule),// 当需要客户端特性限制时取消注释此模块 - // typeof(AbpFeaturesValidationRedisClientModule),// 当需要客户端特性限制时取消注释此模块 - typeof(AbpDbFinderMultiTenancyModule), - typeof(AbpCachingStackExchangeRedisModule), - typeof(AbpAspNetCoreHttpOverridesModule), - typeof(AbpLocalizationCultureMapModule), - typeof(AbpAutofacModule) - )] + typeof(AbpSerilogEnrichersApplicationModule), + typeof(AbpSerilogEnrichersUniqueIdModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpAuditLoggingElasticsearchModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(AbpUINavigationVueVbenAdminModule), + // typeof(AbpOssManagementAliyunModule), + typeof(AbpOssManagementFileSystemModule), // 本地文件系统提供者模块 + typeof(AbpOssManagementFileSystemImageSharpModule), // 本地文件系统图形处理模块 + typeof(AbpOssManagementApplicationModule), + typeof(AbpOssManagementHttpApiModule), + typeof(AbpOssManagementSettingManagementModule), + typeof(PlatformApplicationModule), + typeof(PlatformHttpApiModule), + typeof(PlatformEntityFrameworkCoreModule), + typeof(AbpIdentityHttpApiClientModule), + typeof(AbpHttpClientIdentityModelWebModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), + typeof(AbpNotificationModule), + typeof(AbpEmailingExceptionHandlingModule), + typeof(AbpCAPEventBusModule), + typeof(AbpFeaturesValidationRedisModule), + // typeof(AbpFeaturesClientModule),// 当需要客户端特性限制时取消注释此模块 + // typeof(AbpFeaturesValidationRedisClientModule),// 当需要客户端特性限制时取消注释此模块 + typeof(AbpDbFinderMultiTenancyModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpAspNetCoreHttpOverridesModule), + typeof(AbpLocalizationCultureMapModule), + typeof(AbpAutofacModule) + )] public partial class PlatformManagementHttpApiHostModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) diff --git a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json index 28721ef2f..7d29039dd 100644 --- a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json @@ -15,7 +15,7 @@ "DotNetCore": "Information" } }, - "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName" ], + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], "WriteTo": [ { "Name": "Console", diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj index 6dc01c194..1e029e6c9 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj @@ -54,6 +54,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs index b599c80c6..e0b42684b 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs @@ -17,6 +17,7 @@ using LINGYUN.Abp.Notifications.SignalR; using LINGYUN.Abp.Notifications.Sms; using LINGYUN.Abp.Notifications.WeChat.MiniProgram; using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; @@ -38,6 +39,7 @@ namespace LY.MicroService.RealtimeMessage { [DependsOn( typeof(AbpSerilogEnrichersApplicationModule), + typeof(AbpSerilogEnrichersUniqueIdModule), typeof(AbpAspNetCoreSerilogModule), typeof(AbpAuditLoggingElasticsearchModule), typeof(AbpAspNetCoreMultiTenancyModule), diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json index 28721ef2f..7d29039dd 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json @@ -15,7 +15,7 @@ "DotNetCore": "Information" } }, - "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName" ], + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], "WriteTo": [ { "Name": "Console", diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj index d624a7ca9..9c31de879 100644 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj @@ -43,6 +43,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs index ce629ca57..647c6db9d 100644 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs @@ -5,6 +5,7 @@ using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.MultiTenancy.DbFinder; using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.WorkflowCore.Components; using LINGYUN.Abp.WorkflowCore.DistributedLock; using LINGYUN.Abp.WorkflowCore.LifeCycleEvent; @@ -37,36 +38,37 @@ using Volo.Abp.TenantManagement.EntityFrameworkCore; namespace LY.MicroService.WorkflowManagement; [DependsOn( - typeof(AbpSerilogEnrichersApplicationModule), - typeof(AbpAuditLoggingElasticsearchModule), - typeof(AbpAspNetCoreSerilogModule), - typeof(AbpEventBusRabbitMqModule), - typeof(AbpBlobStoringOssManagementModule), - typeof(WorkflowManagementApplicationModule), - typeof(WorkflowManagementHttpApiModule), - typeof(WorkflowManagementEntityFrameworkCoreModule), - typeof(AbpWorkflowCoreComponentsModule), - typeof(AbpWorkflowCoreDistributedLockModule), - typeof(AbpWorkflowCoreLifeCycleEventModule), - typeof(AbpWorkflowCoreRabbitMQModule), - typeof(AbpWorkflowCorePersistenceEntityFrameworkCoreModule), - typeof(AbpEntityFrameworkCoreMySQLModule), - typeof(AbpAspNetCoreAuthenticationJwtBearerModule), - typeof(AbpEmailingExceptionHandlingModule), - typeof(AbpHttpClientIdentityModelWebModule), - typeof(AbpAspNetCoreMultiTenancyModule), - typeof(AbpDbFinderMultiTenancyModule), - typeof(AbpFeatureManagementEntityFrameworkCoreModule), - typeof(AbpPermissionManagementEntityFrameworkCoreModule), - typeof(AbpSettingManagementEntityFrameworkCoreModule), - typeof(AbpTenantManagementEntityFrameworkCoreModule), - typeof(AbpLocalizationManagementEntityFrameworkCoreModule), - typeof(AbpDataDbMigratorModule), - typeof(AbpCachingStackExchangeRedisModule), - typeof(AbpAspNetCoreMvcModule), - typeof(AbpSwashbuckleModule), - typeof(AbpAutofacModule) - )] + typeof(AbpSerilogEnrichersApplicationModule), + typeof(AbpSerilogEnrichersUniqueIdModule), + typeof(AbpAuditLoggingElasticsearchModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpEventBusRabbitMqModule), + typeof(AbpBlobStoringOssManagementModule), + typeof(WorkflowManagementApplicationModule), + typeof(WorkflowManagementHttpApiModule), + typeof(WorkflowManagementEntityFrameworkCoreModule), + typeof(AbpWorkflowCoreComponentsModule), + typeof(AbpWorkflowCoreDistributedLockModule), + typeof(AbpWorkflowCoreLifeCycleEventModule), + typeof(AbpWorkflowCoreRabbitMQModule), + typeof(AbpWorkflowCorePersistenceEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), + typeof(AbpEmailingExceptionHandlingModule), + typeof(AbpHttpClientIdentityModelWebModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(AbpDbFinderMultiTenancyModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpAspNetCoreMvcModule), + typeof(AbpSwashbuckleModule), + typeof(AbpAutofacModule) + )] public partial class WorkflowManagementHttpApiHostModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json index 95b9dd93b..67e1bc4bd 100644 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json @@ -14,7 +14,7 @@ "Microsoft": "Information" } }, - "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName" ], + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], "WriteTo": [ { "Name": "Console", diff --git a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs index 630183659..0dee706bc 100644 --- a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs +++ b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs @@ -6,6 +6,7 @@ using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.MultiTenancy.DbFinder; using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Sms.Aliyun; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -26,33 +27,34 @@ using Volo.Abp.TenantManagement.EntityFrameworkCore; namespace LY.MicroService.IdentityServer; [DependsOn( - typeof(AbpSerilogEnrichersApplicationModule), - typeof(AbpAspNetCoreSerilogModule), - typeof(AbpAspNetCoreMultiTenancyModule), - typeof(LINGYUN.Abp.Account.AbpAccountApplicationModule), - typeof(LINGYUN.Abp.Account.AbpAccountHttpApiModule), - typeof(LINGYUN.Abp.Identity.AbpIdentityApplicationModule), - typeof(LINGYUN.Abp.Identity.AbpIdentityHttpApiModule), - typeof(LINGYUN.Abp.IdentityServer.AbpIdentityServerApplicationModule), - typeof(LINGYUN.Abp.IdentityServer.AbpIdentityServerHttpApiModule), - typeof(LINGYUN.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule), - typeof(LINGYUN.Abp.IdentityServer.EntityFrameworkCore.AbpIdentityServerEntityFrameworkCoreModule), - typeof(AbpEntityFrameworkCoreMySQLModule), - typeof(AbpTenantManagementEntityFrameworkCoreModule), - typeof(AbpSettingManagementEntityFrameworkCoreModule), - typeof(AbpPermissionManagementEntityFrameworkCoreModule), - typeof(AbpLocalizationManagementEntityFrameworkCoreModule), - typeof(AbpAspNetCoreAuthenticationJwtBearerModule), - typeof(AbpAuditLoggingElasticsearchModule), - typeof(AbpEmailingExceptionHandlingModule), - typeof(AbpCAPEventBusModule), - typeof(AbpAliyunSmsModule), - typeof(AbpDbFinderMultiTenancyModule), - typeof(AbpCachingStackExchangeRedisModule), - typeof(AbpAspNetCoreHttpOverridesModule), - typeof(AbpLocalizationCultureMapModule), - typeof(AbpAutofacModule) - )] + typeof(AbpSerilogEnrichersApplicationModule), + typeof(AbpSerilogEnrichersUniqueIdModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpAspNetCoreMultiTenancyModule), + typeof(LINGYUN.Abp.Account.AbpAccountApplicationModule), + typeof(LINGYUN.Abp.Account.AbpAccountHttpApiModule), + typeof(LINGYUN.Abp.Identity.AbpIdentityApplicationModule), + typeof(LINGYUN.Abp.Identity.AbpIdentityHttpApiModule), + typeof(LINGYUN.Abp.IdentityServer.AbpIdentityServerApplicationModule), + typeof(LINGYUN.Abp.IdentityServer.AbpIdentityServerHttpApiModule), + typeof(LINGYUN.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule), + typeof(LINGYUN.Abp.IdentityServer.EntityFrameworkCore.AbpIdentityServerEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpLocalizationManagementEntityFrameworkCoreModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), + typeof(AbpAuditLoggingElasticsearchModule), + typeof(AbpEmailingExceptionHandlingModule), + typeof(AbpCAPEventBusModule), + typeof(AbpAliyunSmsModule), + typeof(AbpDbFinderMultiTenancyModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpAspNetCoreHttpOverridesModule), + typeof(AbpLocalizationCultureMapModule), + typeof(AbpAutofacModule) + )] public partial class IdentityServerHttpApiHostModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) diff --git a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj index 48bf710da..fe4576d55 100644 --- a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj @@ -68,6 +68,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/appsettings.json b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/appsettings.json index 3be84adf2..873315f9a 100644 --- a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/appsettings.json +++ b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/appsettings.json @@ -13,7 +13,7 @@ "DotNetCore": "Debug" } }, - "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName" ], + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], "WriteTo": [ { "Name": "Console", diff --git a/aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs b/aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs index 2fe359a05..5b38aa36a 100644 --- a/aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs +++ b/aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs @@ -10,6 +10,7 @@ using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.MultiTenancy.DbFinder; using LINGYUN.Abp.PermissionManagement.Identity; using LINGYUN.Abp.Serilog.Enrichers.Application; +using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Sms.Aliyun; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -36,34 +37,35 @@ using Volo.Abp.TenantManagement.EntityFrameworkCore; namespace LY.MicroService.IdentityServer; [DependsOn( - typeof(AbpSerilogEnrichersApplicationModule), - typeof(AbpAspNetCoreSerilogModule), - typeof(AbpAccountWebIdentityServerModule), - typeof(AbpAccountApplicationModule), - typeof(AbpAspNetCoreMvcUiBasicThemeModule), - typeof(AbpAutofacModule), - typeof(AbpCachingStackExchangeRedisModule), - typeof(AbpEntityFrameworkCoreMySQLModule), - typeof(AbpIdentityEntityFrameworkCoreModule), - typeof(AbpIdentityApplicationModule), - // typeof(AbpIdentityHttpApiModule), - typeof(AbpIdentityServerEntityFrameworkCoreModule), - typeof(AbpIdentityServerSmsValidatorModule), - typeof(AbpIdentityServerWeChatModule), - typeof(AbpPermissionManagementDomainIdentityModule), - typeof(AbpPermissionManagementEntityFrameworkCoreModule), - typeof(AbpSettingManagementEntityFrameworkCoreModule), - typeof(AbpFeatureManagementEntityFrameworkCoreModule), - typeof(AbpTenantManagementEntityFrameworkCoreModule), - typeof(AbpDataDbMigratorModule), - typeof(AbpAspNetCoreAuthenticationJwtBearerModule), - typeof(AbpAuditLoggingElasticsearchModule), // 放在 AbpIdentity 模块之后,避免被覆盖 - typeof(AbpAspNetCoreHttpOverridesModule), - typeof(AbpLocalizationCultureMapModule), - typeof(AbpDbFinderMultiTenancyModule), - typeof(AbpCAPEventBusModule), - typeof(AbpAliyunSmsModule) - )] + typeof(AbpSerilogEnrichersApplicationModule), + typeof(AbpSerilogEnrichersUniqueIdModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpAccountWebIdentityServerModule), + typeof(AbpAccountApplicationModule), + typeof(AbpAspNetCoreMvcUiBasicThemeModule), + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpEntityFrameworkCoreMySQLModule), + typeof(AbpIdentityEntityFrameworkCoreModule), + typeof(AbpIdentityApplicationModule), + // typeof(AbpIdentityHttpApiModule), + typeof(AbpIdentityServerEntityFrameworkCoreModule), + typeof(AbpIdentityServerSmsValidatorModule), + typeof(AbpIdentityServerWeChatModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpFeatureManagementEntityFrameworkCoreModule), + typeof(AbpTenantManagementEntityFrameworkCoreModule), + typeof(AbpDataDbMigratorModule), + typeof(AbpAspNetCoreAuthenticationJwtBearerModule), + typeof(AbpAuditLoggingElasticsearchModule), // 放在 AbpIdentity 模块之后,避免被覆盖 + typeof(AbpAspNetCoreHttpOverridesModule), + typeof(AbpLocalizationCultureMapModule), + typeof(AbpDbFinderMultiTenancyModule), + typeof(AbpCAPEventBusModule), + typeof(AbpAliyunSmsModule) + )] public partial class IdentityServerModule : AbpModule { private const string DefaultCorsPolicyName = "Default"; diff --git a/aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj b/aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj index 9743ab793..10ce6782d 100644 --- a/aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj +++ b/aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj @@ -58,6 +58,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.identityServer/appsettings.json b/aspnet-core/services/LY.MicroService.identityServer/appsettings.json index 18ccb536e..61952cf75 100644 --- a/aspnet-core/services/LY.MicroService.identityServer/appsettings.json +++ b/aspnet-core/services/LY.MicroService.identityServer/appsettings.json @@ -13,7 +13,7 @@ "DotNetCore": "Information" } }, - "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName" ], + "Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ], "WriteTo": [ { "Name": "Console",