Browse Source

Merge pull request #448 from colinin/5.0.0

feat logging module
pull/474/head
yx lin 4 years ago
committed by GitHub
parent
commit
46c5432947
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/vue/src/api/logging/model/loggingModel.ts
  2. 2
      apps/vue/src/views/sys/logging/components/LoggingModal.vue
  3. 2
      apps/vue/src/views/sys/logging/components/LoggingTable.vue
  4. 14
      aspnet-core/LINGYUN.MicroService.All.sln
  5. 31
      aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs
  6. 21
      aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs
  7. 1
      aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs
  8. 7
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs
  9. 3
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj
  10. 4
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs
  11. 11
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs
  12. 3
      aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/FodyWeavers.xml
  13. 30
      aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/FodyWeavers.xsd
  14. 15
      aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN.Abp.IdGenerator.csproj
  15. 17
      aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/AbpIdGeneratorModule.cs
  16. 6
      aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/IDistributedIdGenerator.cs
  17. 58
      aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdGenerator.cs
  18. 29
      aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdOptions.cs
  19. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj
  20. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs
  21. 13
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs
  22. 11
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs
  23. 7
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/ISnowflakeIdrGenerator.cs
  24. 24
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/SnowflakeIdOptions.cs
  25. 1
      aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN.Abp.Logging.Serilog.Elasticsearch.csproj
  26. 3
      aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMapperProfile.cs
  27. 52
      aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs
  28. 4
      aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs
  29. 1
      aspnet-core/modules/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs
  30. 3
      aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/FodyWeavers.xml
  31. 30
      aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/FodyWeavers.xsd
  32. 19
      aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj
  33. 10
      aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogEnrichersUniqueIdModule.cs
  34. 7
      aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogUniqueIdConsts.cs
  35. 21
      aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs
  36. 16
      aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/Serilog/UniqueIdLoggerConfigurationExtensions.cs
  37. 79
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs
  38. 1
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/LY.MicroService.BackendAdmin.HttpApi.Host.csproj
  39. 2
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Properties/launchSettings.json
  40. 2
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/appsettings.json
  41. 1
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj
  42. 2
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LocalizationManagementHttpApiHostModule.cs
  43. 2
      aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/appsettings.json
  44. 1
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj
  45. 72
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs
  46. 2
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/appsettings.json
  47. 1
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj
  48. 2
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/RealtimeMessageHttpApiHostModule.cs
  49. 2
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/appsettings.json
  50. 1
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj
  51. 62
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/WorkflowManagementHttpApiHostModule.cs
  52. 2
      aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/appsettings.json
  53. 56
      aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/IdentityServerHttpApiHostModule.cs
  54. 1
      aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj
  55. 2
      aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/appsettings.json
  56. 58
      aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs
  57. 1
      aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj
  58. 2
      aspnet-core/services/LY.MicroService.identityServer/appsettings.json
  59. 51
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/LINGYUN.MicroService.Internal.ApiGateway.sln
  60. 9
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/InternalApiGatewayModule.cs
  61. 2
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/LINGYUN.MicroService.Internal.ApiGateway.csproj
  62. 2
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/appsettings.json

1
apps/vue/src/api/logging/model/loggingModel.ts

@ -11,6 +11,7 @@ export interface LogException {
}
export interface LogField {
id: string;
machineName: string;
environment: string;
application: string;

2
apps/vue/src/views/sys/logging/components/LoggingModal.vue

@ -126,7 +126,7 @@
const [registerModal] = useModalInner((model) => {
activeKey.value = 'basic';
modelRef.value = {} as Log;
get(model.timeStamp).then((res) => {
get(model.fields.id).then((res) => {
modelRef.value = res;
});
});

2
apps/vue/src/views/sys/logging/components/LoggingTable.vue

@ -41,7 +41,7 @@
const { L } = useLocalization('AbpAuditLogging');
const [registerModal, { openModal }] = useModal();
const [registerTable] = useTable({
rowKey: 'timeStamp',
rowKey: 'fields.id',
title: L('Logging'),
columns: getDataColumns(),
api: getList,

14
aspnet-core/LINGYUN.MicroService.All.sln

@ -363,6 +363,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtection"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtection.EntityFrameworkCore", "modules\data-protection\LINGYUN.Abp.DataProtection.EntityFrameworkCore\LINGYUN.Abp.DataProtection.EntityFrameworkCore.csproj", "{19B860CA-2E1E-45CC-A5E2-ED3F2BCEAB5D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.IdGenerator", "modules\common\LINGYUN.Abp.IdGenerator\LINGYUN.Abp.IdGenerator.csproj", "{440C9BD9-85EA-4473-AB1C-7C3562DF4915}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Serilog.Enrichers.UniqueId", "modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj", "{23C3B247-523A-4FBF-B785-2F035E0089BD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -941,6 +945,14 @@ Global
{19B860CA-2E1E-45CC-A5E2-ED3F2BCEAB5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19B860CA-2E1E-45CC-A5E2-ED3F2BCEAB5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19B860CA-2E1E-45CC-A5E2-ED3F2BCEAB5D}.Release|Any CPU.Build.0 = Release|Any CPU
{440C9BD9-85EA-4473-AB1C-7C3562DF4915}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{440C9BD9-85EA-4473-AB1C-7C3562DF4915}.Debug|Any CPU.Build.0 = Debug|Any CPU
{440C9BD9-85EA-4473-AB1C-7C3562DF4915}.Release|Any CPU.ActiveCfg = Release|Any CPU
{440C9BD9-85EA-4473-AB1C-7C3562DF4915}.Release|Any CPU.Build.0 = Release|Any CPU
{23C3B247-523A-4FBF-B785-2F035E0089BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23C3B247-523A-4FBF-B785-2F035E0089BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23C3B247-523A-4FBF-B785-2F035E0089BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23C3B247-523A-4FBF-B785-2F035E0089BD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1120,6 +1132,8 @@ Global
{529DF802-97C4-4BF2-BE7C-39663B3D9EA3} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{BB840DEE-1F5F-45AA-A82F-4E7B7DC4F156} = {529DF802-97C4-4BF2-BE7C-39663B3D9EA3}
{19B860CA-2E1E-45CC-A5E2-ED3F2BCEAB5D} = {529DF802-97C4-4BF2-BE7C-39663B3D9EA3}
{440C9BD9-85EA-4473-AB1C-7C3562DF4915} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{23C3B247-523A-4FBF-B785-2F035E0089BD} = {6FC0578B-CDF1-43AD-9F7E-4AA7E4720A02}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

31
aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs

@ -242,51 +242,51 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
if (startTime.HasValue)
{
querys.Add((log) => log.DateRange((q) => q.Field(f => f.ExecutionTime).GreaterThanOrEquals(startTime)));
querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(AuditLog.ExecutionTime))).GreaterThanOrEquals(startTime)));
}
if (endTime.HasValue)
{
querys.Add((log) => log.DateRange((q) => q.Field(f => f.ExecutionTime).LessThanOrEquals(endTime)));
querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(AuditLog.ExecutionTime))).LessThanOrEquals(endTime)));
}
if (!httpMethod.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.HttpMethod.Suffix("keyword")).Value(httpMethod)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.HttpMethod))).Value(httpMethod)));
}
if (!url.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Match((q) => q.Field(f => f.Url.Suffix("keyword")).Query(url)));
querys.Add((log) => log.Match((q) => q.Field(GetField(nameof(AuditLog.Url))).Query(url)));
}
if (userId.HasValue)
{
querys.Add((log) => log.Term((q) => q.Field(f => f.UserId.Suffix("keyword")).Value(userId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.UserId))).Value(userId)));
}
if (!userName.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.UserName.Suffix("keyword")).Value(userName)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.UserName))).Value(userName)));
}
if (!applicationName.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.ApplicationName.Suffix("keyword")).Value(applicationName)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ApplicationName))).Value(applicationName)));
}
if (!correlationId.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.CorrelationId.Suffix("keyword")).Value(correlationId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.CorrelationId))).Value(correlationId)));
}
if (!clientId.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.ClientId.Suffix("keyword")).Value(clientId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ClientId))).Value(clientId)));
}
if (!clientIpAddress.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.ClientIpAddress.Suffix("keyword")).Value(clientIpAddress)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.ClientIpAddress))).Value(clientIpAddress)));
}
if (maxExecutionDuration.HasValue)
{
querys.Add((log) => log.Range((q) => q.Field(f => f.ExecutionDuration).LessThanOrEquals(maxExecutionDuration)));
querys.Add((log) => log.Range((q) => q.Field(GetField(nameof(AuditLog.ExecutionDuration))).LessThanOrEquals(maxExecutionDuration)));
}
if (minExecutionDuration.HasValue)
{
querys.Add((log) => log.Range((q) => q.Field(f => f.ExecutionDuration).GreaterThanOrEquals(minExecutionDuration)));
querys.Add((log) => log.Range((q) => q.Field(GetField(nameof(AuditLog.ExecutionDuration))).GreaterThanOrEquals(minExecutionDuration)));
}
@ -317,7 +317,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
if (httpStatusCode.HasValue)
{
querys.Add((log) => log.Term((q) => q.Field(f => f.HttpStatusCode).Value(httpStatusCode)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(AuditLog.HttpStatusCode))).Value(httpStatusCode)));
}
return querys;
@ -344,7 +344,10 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
{ "CorrelationId", "CorrelationId.keyword" },
{ "BrowserInfo", "BrowserInfo.keyword" },
{ "HttpMethod", "HttpMethod.keyword" },
{ "Url", "Url.keyword" }
{ "Url", "Url.keyword" },
{ "ExecutionDuration", "ExecutionDuration" },
{ "ExecutionTime", "ExecutionTime" },
{ "HttpStatusCode", "HttpStatusCode" },
};
protected virtual string GetField(string field)
{

21
aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs

@ -192,43 +192,43 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
if (startTime.HasValue)
{
querys.Add((log) => log.DateRange((q) => q.Field(f => f.CreationTime).GreaterThanOrEquals(startTime)));
querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SecurityLog.CreationTime))).GreaterThanOrEquals(startTime)));
}
if (endTime.HasValue)
{
querys.Add((log) => log.DateRange((q) => q.Field(f => f.CreationTime).LessThanOrEquals(endTime)));
querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SecurityLog.CreationTime))).LessThanOrEquals(endTime)));
}
if (!applicationName.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.ApplicationName.Suffix("keyword")).Value(applicationName)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ApplicationName))).Value(applicationName)));
}
if (!identity.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.Identity.Suffix("keyword")).Value(identity)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.Identity))).Value(identity)));
}
if (!action.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.Action.Suffix("keyword")).Value(action)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.Action))).Value(action)));
}
if (userId.HasValue)
{
querys.Add((log) => log.Term((q) => q.Field(f => f.UserId.Suffix("keyword")).Value(userId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.UserId))).Value(userId)));
}
if (!userName.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.UserName.Suffix("keyword")).Value(userName)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.UserName))).Value(userName)));
}
if (!clientId.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.ClientId.Suffix("keyword")).Value(clientId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ClientId))).Value(clientId)));
}
if (!clientIpAddress.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.ClientIpAddress.Suffix("keyword")).Value(clientIpAddress)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.ClientIpAddress))).Value(clientIpAddress)));
}
if (!correlationId.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.CorrelationId.Suffix("keyword")).Value(correlationId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SecurityLog.CorrelationId))).Value(correlationId)));
}
return querys;
@ -253,6 +253,7 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch
{ "ClientIpAddress", "ClientIpAddress.keyword" },
{ "ClientId", "ClientId.keyword" },
{ "CorrelationId", "CorrelationId.keyword" },
{ "CreationTime", "CreationTime" },
};
protected virtual string GetField(string field)
{

1
aspnet-core/modules/auditing/LINGYUN.Abp.Auditing.Application.Contracts/LINGYUN/Abp/Auditing/Logging/Dto/LogFieldDto.cs

@ -2,6 +2,7 @@
{
public class LogFieldDto
{
public string Id { get; set; }
public string MachineName { get; set; }
public string Environment { get; set; }
public string Application { get; set; }

7
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Hubs/MessagesHub.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.IM.Contract;
using LINGYUN.Abp.IdGenerator;
using LINGYUN.Abp.IM.Contract;
using LINGYUN.Abp.IM.Groups;
using LINGYUN.Abp.IM.Localization;
using LINGYUN.Abp.IM.Messages;
@ -28,7 +29,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
protected IUserOnlineChanger OnlineChanger => LazyServiceProvider.LazyGetService<IUserOnlineChanger>();
protected ISnowflakeIdrGenerator SnowflakeIdrGenerator => LazyServiceProvider.LazyGetRequiredService<ISnowflakeIdrGenerator>();
protected IDistributedIdGenerator DistributedIdGenerator => LazyServiceProvider.LazyGetRequiredService<IDistributedIdGenerator>();
protected IExceptionToErrorInfoConverter ErrorInfoConverter => LazyServiceProvider.LazyGetRequiredService<IExceptionToErrorInfoConverter>();
@ -147,7 +148,7 @@ namespace LINGYUN.Abp.IM.SignalR.Hubs
try
{
chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous);
chatMessage.MessageId = SnowflakeIdrGenerator.Create().ToString();
chatMessage.MessageId = DistributedIdGenerator.Create().ToString();
await MessageStore.StoreMessageAsync(chatMessage);
if (!chatMessage.GroupId.IsNullOrWhiteSpace())

3
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
@ -22,6 +22,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.IdGenerator\LINGYUN.Abp.IdGenerator.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.RealTime\LINGYUN.Abp.RealTime.csproj" />
</ItemGroup>

4
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/AbpIMModule.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.IM.Localization;
using LINGYUN.Abp.RealTime;
using LINGYUN.Abp.IdGenerator;
using Volo.Abp.EventBus;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
@ -10,7 +11,8 @@ namespace LINGYUN.Abp.IM
[DependsOn(
typeof(AbpEventBusModule),
typeof(AbpRealTimeModule),
typeof(AbpLocalizationModule))]
typeof(AbpLocalizationModule),
typeof(AbpIdGeneratorModule))]
public class AbpIMModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

11
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.RealTime;
using LINGYUN.Abp.IdGenerator;
using LINGYUN.Abp.RealTime;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
@ -9,19 +10,19 @@ namespace LINGYUN.Abp.IM.Messages
public class MessageSender : IMessageSender, ITransientDependency
{
protected IDistributedEventBus EventBus { get; }
protected ISnowflakeIdrGenerator SnowflakeIdrGenerator { get; }
protected IDistributedIdGenerator DistributedIdGenerator { get; }
public MessageSender(
IDistributedEventBus eventBus,
ISnowflakeIdrGenerator snowflakeIdrGenerator)
IDistributedIdGenerator distributedIdGenerator)
{
EventBus = eventBus;
SnowflakeIdrGenerator = snowflakeIdrGenerator;
DistributedIdGenerator = distributedIdGenerator;
}
public virtual async Task<string> SendMessageAsync(ChatMessage chatMessage)
{
chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous);
chatMessage.MessageId = SnowflakeIdrGenerator.Create().ToString();
chatMessage.MessageId = DistributedIdGenerator.Create().ToString();
// 如果先存储的话,就紧耦合消息处理模块了
// await Store.StoreMessageAsync(chatMessage);
var eto = new RealTimeEto<ChatMessage>(chatMessage);

3
aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

15
aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN.Abp.IdGenerator.csproj

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Core" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
</Project>

17
aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/AbpIdGeneratorModule.cs

@ -0,0 +1,17 @@
using LINGYUN.Abp.IdGenerator.Snowflake;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.IdGenerator;
public class AbpIdGeneratorModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var snowflakeIdOptions = new SnowflakeIdOptions();
context.Services.ExecutePreConfiguredActions(snowflakeIdOptions);
context.Services.TryAddSingleton<IDistributedIdGenerator>(SnowflakeIdGenerator.Create(snowflakeIdOptions));
}
}

6
aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/IDistributedIdGenerator.cs

@ -0,0 +1,6 @@
namespace LINGYUN.Abp.IdGenerator;
public interface IDistributedIdGenerator
{
long Create();
}

58
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/SnowflakeIdrGenerator.cs → aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdGenerator.cs

@ -1,13 +1,11 @@
using Microsoft.Extensions.Options;
using System;
using System;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.RealTime
namespace LINGYUN.Abp.IdGenerator.Snowflake
{
// reference: https://github.com/dotnetcore/CAP
// reference: https://blog.csdn.net/lq18050010830/article/details/89845790
public class SnowflakeIdrGenerator : ISnowflakeIdrGenerator, ISingletonDependency
public class SnowflakeIdGenerator : IDistributedIdGenerator
{
public const long Twepoch = 1288834974657L;
@ -22,48 +20,48 @@ namespace LINGYUN.Abp.RealTime
protected int TimestampLeftShift { get; }
protected long SequenceMask { get; }
protected SnowflakeIdOptions Options { get; }
public SnowflakeIdrGenerator(IOptions<SnowflakeIdOptions> options)
private SnowflakeIdGenerator(SnowflakeIdOptions options)
{
Options = options.Value;
WorkerIdShift = Options.SequenceBits;
DatacenterIdShift = Options.SequenceBits + Options.WorkerIdBits;
TimestampLeftShift = Options.SequenceBits + Options.WorkerIdBits + Options.DatacenterIdBits;
SequenceMask = -1L ^ (-1L << Options.SequenceBits);
WorkerIdShift = options.SequenceBits;
DatacenterIdShift = options.SequenceBits + options.WorkerIdBits;
TimestampLeftShift = options.SequenceBits + options.WorkerIdBits + options.DatacenterIdBits;
SequenceMask = -1L ^ (-1L << options.SequenceBits);
}
internal void Initialize(long sequence = 0L)
public static SnowflakeIdGenerator Create(SnowflakeIdOptions options)
{
Sequence = sequence;
MaxWorkerId = -1L ^ (-1L << Options.WorkerIdBits);
MaxDatacenterId = -1L ^ (-1L << Options.DatacenterIdBits);
var idGenerator = new SnowflakeIdGenerator(options)
{
Sequence = options.Sequence,
MaxWorkerId = -1L ^ (-1L << options.WorkerIdBits),
MaxDatacenterId = -1L ^ (-1L << options.DatacenterIdBits)
};
if (!int.TryParse(Environment.GetEnvironmentVariable("WORKERID", EnvironmentVariableTarget.Machine), out var workerId))
{
workerId = RandomHelper.GetRandom((int)MaxWorkerId);
workerId = RandomHelper.GetRandom((int)idGenerator.MaxWorkerId);
}
if (!int.TryParse(Environment.GetEnvironmentVariable("DATACENTERID", EnvironmentVariableTarget.Machine), out var datacenterId))
{
datacenterId = RandomHelper.GetRandom((int)MaxDatacenterId);
datacenterId = RandomHelper.GetRandom((int)idGenerator.MaxDatacenterId);
}
if (workerId > MaxWorkerId || workerId < 0)
throw new ArgumentException($"worker Id can't be greater than {MaxWorkerId} or less than 0");
if (workerId > idGenerator.MaxWorkerId || workerId < 0)
throw new ArgumentException($"worker Id can't be greater than {idGenerator.MaxWorkerId} or less than 0");
if (datacenterId > MaxDatacenterId || datacenterId < 0)
throw new ArgumentException($"datacenter Id can't be greater than {MaxDatacenterId} or less than 0");
if (datacenterId > idGenerator.MaxDatacenterId || datacenterId < 0)
throw new ArgumentException($"datacenter Id can't be greater than {idGenerator.MaxDatacenterId} or less than 0");
idGenerator.WorkerId = workerId;
idGenerator.DatacenterId = datacenterId;
WorkerId = workerId;
DatacenterId = datacenterId;
return idGenerator;
}
public long WorkerId { get; protected set; }
public long DatacenterId { get; protected set; }
public long Sequence { get; protected set; }
public long WorkerId { get; internal set; }
public long DatacenterId { get; internal set; }
public long Sequence { get; internal set; }
public virtual long Create()
{

29
aspnet-core/modules/common/LINGYUN.Abp.IdGenerator/LINGYUN/Abp/IdGenerator/Snowflake/SnowflakeIdOptions.cs

@ -0,0 +1,29 @@
namespace LINGYUN.Abp.IdGenerator.Snowflake;
public class SnowflakeIdOptions
{
/// <summary>
/// 机器Id长度
/// </summary>
public int WorkerIdBits { get; set; }
/// <summary>
/// 机房Id长度
/// </summary>
public int DatacenterIdBits { get; set; }
/// <summary>
/// 12bit 的序号
/// </summary>
public long Sequence { get; set; }
/// <summary>
/// 每秒生成Id的数量
/// </summary>
public int SequenceBits { get; set; }
public SnowflakeIdOptions()
{
WorkerIdBits = 5;
DatacenterIdBits = 5;
Sequence = 0L;
SequenceBits = 12;
}
}

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
@ -16,6 +16,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.IdGenerator\LINGYUN.Abp.IdGenerator.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.RealTime\LINGYUN.Abp.RealTime.csproj" />
</ItemGroup>

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.Notifications.Internal;
using LINGYUN.Abp.IdGenerator;
using LINGYUN.Abp.Notifications.Internal;
using LINGYUN.Abp.RealTime;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@ -16,6 +17,7 @@ namespace LINGYUN.Abp.Notifications
[DependsOn(
typeof(AbpBackgroundWorkersModule),
typeof(AbpBackgroundJobsAbstractionsModule),
typeof(AbpIdGeneratorModule),
typeof(AbpJsonModule),
typeof(AbpRealTimeModule))]
public class AbpNotificationModule : AbpModule

13
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.RealTime;
using LINGYUN.Abp.IdGenerator;
using LINGYUN.Abp.RealTime;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
@ -26,19 +27,19 @@ namespace LINGYUN.Abp.Notifications
/// </summary>
public IDistributedEventBus DistributedEventBus { get; }
/// <summary>
/// Reference to <see cref="IMessageIdGenerator"/>.
/// Reference to <see cref="IDistributedIdGenerator"/>.
/// </summary>
protected ISnowflakeIdrGenerator SnowflakeIdGenerator { get; }
protected IDistributedIdGenerator DistributedIdGenerator { get; }
protected AbpNotificationOptions Options { get; }
public NotificationSender(
IDistributedEventBus distributedEventBus,
ISnowflakeIdrGenerator snowflakeIdrGenerator,
IDistributedIdGenerator distributedIdGenerator,
IOptions<AbpNotificationOptions> options)
{
Options = options.Value;
DistributedEventBus = distributedEventBus;
SnowflakeIdGenerator = snowflakeIdrGenerator;
DistributedIdGenerator = distributedIdGenerator;
Logger = NullLogger<NotificationSender>.Instance;
}
@ -79,7 +80,7 @@ namespace LINGYUN.Abp.Notifications
{
var eto = new NotificationEto<NotificationData>(data)
{
Id = SnowflakeIdGenerator.Create(),
Id = DistributedIdGenerator.Create(),
TenantId = tenantId,
Users = users?.ToList(),
Name = name,

11
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs

@ -1,6 +1,4 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.EventBus.Abstractions;
using Volo.Abp.EventBus.Abstractions;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.RealTime
@ -8,12 +6,5 @@ namespace LINGYUN.Abp.RealTime
[DependsOn(typeof(AbpEventBusAbstractionsModule))]
public class AbpRealTimeModule : AbpModule
{
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
context
.ServiceProvider
.GetRequiredService<SnowflakeIdrGenerator>()
.Initialize();
}
}
}

7
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/ISnowflakeIdrGenerator.cs

@ -1,7 +0,0 @@
namespace LINGYUN.Abp.RealTime
{
public interface ISnowflakeIdrGenerator
{
long Create();
}
}

24
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/SnowflakeIdOptions.cs

@ -1,24 +0,0 @@
namespace LINGYUN.Abp.RealTime
{
public class SnowflakeIdOptions
{
/// <summary>
/// 机器Id长度
/// </summary>
public int WorkerIdBits { get; set; }
/// <summary>
/// 机房Id长度
/// </summary>
public int DatacenterIdBits { get; set; }
/// <summary>
/// 每秒生成Id的数量
/// </summary>
public int SequenceBits { get; set; }
public SnowflakeIdOptions()
{
WorkerIdBits = 5;
DatacenterIdBits = 5;
SequenceBits = 12;
}
}
}

1
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN.Abp.Logging.Serilog.Elasticsearch.csproj

@ -18,6 +18,7 @@
<ProjectReference Include="..\..\elasticsearch\LINGYUN.Abp.Elasticsearch\LINGYUN.Abp.Elasticsearch.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Logging\LINGYUN.Abp.Logging.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
</ItemGroup>
</Project>

3
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/AbpLoggingSerilogElasticsearchMapperProfile.cs

@ -7,7 +7,8 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
public AbpLoggingSerilogElasticsearchMapperProfile()
{
CreateMap<SerilogException, LogException>();
CreateMap<SerilogField, LogField>();
CreateMap<SerilogField, LogField>()
.ForMember(log => log.Id, map => map.MapFrom(slog => slog.UniqueId.ToString()));
CreateMap<SerilogInfo, LogInfo>();
}
}

52
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.Elasticsearch;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
@ -71,8 +72,8 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
},
{
"term": {
"@timestamp": {
"value": "2021-10-31T09:53:12.3406273+08:00"
"fields.UniqueId": {
"value": "1474021081433481216"
}
}
}
@ -87,9 +88,9 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
(q) => q.Bool(
(b) => b.Must(
(s) => s.Term(
(t) => t.Field("@timestamp").Value(id)),
(t) => t.Field(GetField(nameof(SerilogInfo.Fields.UniqueId))).Value(id)),
(s) => s.Term(
(t) => t.Field(f => f.Fields.TenantId.Suffix("keyword")).Value(_currentTenant.GetId()))))),
(t) => t.Field(GetField(nameof(SerilogInfo.Fields.TenantId))).Value(_currentTenant.GetId()))))),
cancellationToken);
}
else
@ -100,8 +101,8 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
"must": [
{
"term": {
"@timestamp": {
"value": "2021-10-31T09:53:12.3406273+08:00"
"fields.UniqueId": {
"value": "1474021081433481216"
}
}
}
@ -116,7 +117,7 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
(q) => q.Bool(
(b) => b.Must(
(s) => s.Term(
(t) => t.Field("@timestamp").Value(id))))),
(t) => t.Field(GetField(nameof(SerilogInfo.Fields.UniqueId))).Value(id))))),
cancellationToken);
}
@ -210,7 +211,9 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase)
? SortOrder.Ascending : SortOrder.Descending;
sorting = sorting ?? "timestamp";
sorting = !sorting.IsNullOrWhiteSpace()
? sorting.Split()[0]
: nameof(SerilogInfo.TimeStamp);
var querys = BuildQueryDescriptor(
startTime,
@ -241,7 +244,9 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
var response = await client.SearchAsync<SerilogInfo>((dsl) =>
dsl.Index(CreateIndex())
.Query(log => log.Bool(b => b.Must(querys.ToArray())))
.Query(log =>
log.Bool(b =>
b.Must(querys.ToArray())))
.Source(SourceFilter)
.Sort(log => log.Field(GetField(sorting), sortOrder))
.From(skipCount)
@ -270,55 +275,56 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
if (_currentTenant.IsAvailable)
{
querys.Add((log) => log.Term((q) => q.Field((f) => f.Fields.TenantId.Suffix("keyword")).Value(_currentTenant.GetId())));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.TenantId))).Value(_currentTenant.GetId())));
}
if (startTime.HasValue)
{
querys.Add((log) => log.DateRange((q) => q.Field(f => f.TimeStamp).GreaterThanOrEquals(startTime)));
querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SerilogInfo.TimeStamp))).GreaterThanOrEquals(startTime)));
}
if (endTime.HasValue)
{
querys.Add((log) => log.DateRange((q) => q.Field(f => f.TimeStamp).LessThanOrEquals(endTime)));
querys.Add((log) => log.DateRange((q) => q.Field(GetField(nameof(SerilogInfo.TimeStamp))).LessThanOrEquals(endTime)));
}
if (level.HasValue)
{
querys.Add((log) => log.Term((q) => q.Field(f => f.Level.Suffix("keyword")).Value(level.ToString())));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Level))).Value(level.ToString())));
}
if (!machineName.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field((f) => f.Fields.MachineName.Suffix("keyword")).Value(machineName)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.MachineName))).Value(machineName)));
}
if (!environment.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field((f) => f.Fields.Environment.Suffix("keyword")).Value(environment)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Environment))).Value(environment)));
}
if (!application.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field((f) => f.Fields.Application.Suffix("keyword")).Value(application)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Application))).Value(application)));
}
if (!context.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field((f) => f.Fields.Context.Suffix("keyword")).Value(context)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.Context))).Value(context)));
}
if (!requestId.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Match((q) => q.Field(f => f.Fields.RequestId.Suffix("keyword")).Query(requestId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.RequestId))).Value(requestId)));
}
if (!requestPath.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.Fields.RequestPath.Suffix("keyword")).Value(requestPath)));
// 模糊匹配
querys.Add((log) => log.MatchPhrasePrefix((q) => q.Field(f => f.Fields.RequestPath).Query(requestPath)));
}
if (!correlationId.IsNullOrWhiteSpace())
{
querys.Add((log) => log.Term((q) => q.Field(f => f.Fields.CorrelationId.Suffix("keyword")).Value(correlationId)));
querys.Add((log) => log.MatchPhrase((q) => q.Field(GetField(nameof(SerilogInfo.Fields.CorrelationId))).Query(correlationId)));
}
if (processId.HasValue)
{
querys.Add((log) => log.Term((q) => q.Field(f => f.Fields.ProcessId).Value(processId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.ProcessId))).Value(processId)));
}
if (threadId.HasValue)
{
querys.Add((log) => log.Term((q) => q.Field(f => f.Fields.ThreadId).Value(threadId)));
querys.Add((log) => log.Term((q) => q.Field(GetField(nameof(SerilogInfo.Fields.ThreadId))).Value(threadId)));
}
if (hasException.HasValue)
@ -386,6 +392,8 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
{ "userid", "fields.UserId.keyword" },
{ "processid", "fields.ProcessId" },
{ "threadid", "fields.ThreadId" },
{ "id", $"fields.{AbpSerilogUniqueIdConsts.UniqueIdPropertyName}" },
{ "uniqueid", $"fields.{AbpSerilogUniqueIdConsts.UniqueIdPropertyName}" },
};
protected virtual string GetField(string field)
{

4
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogField.cs

@ -1,10 +1,14 @@
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using System;
namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch
{
public class SerilogField
{
[Nest.PropertyName(AbpSerilogUniqueIdConsts.UniqueIdPropertyName)]
public long UniqueId { get; set; }
[Nest.PropertyName(AbpLoggingEnricherPropertyNames.MachineName)]
public string MachineName { get; set; }

1
aspnet-core/modules/logging/LINGYUN.Abp.Logging/LINGYUN/Abp/AuditLogging/LogField.cs

@ -2,6 +2,7 @@
{
public class LogField
{
public string Id { get; set; }
public string MachineName { get; set; }
public string Environment { get; set; }
public string Application { get; set; }

3
aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

30
aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

19
aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog" Version="$(SerilogPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\common\LINGYUN.Abp.IdGenerator\LINGYUN.Abp.IdGenerator.csproj" />
</ItemGroup>
</Project>

10
aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogEnrichersUniqueIdModule.cs

@ -0,0 +1,10 @@
using LINGYUN.Abp.IdGenerator;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId
{
[DependsOn(typeof(AbpIdGeneratorModule))]
public class AbpSerilogEnrichersUniqueIdModule : AbpModule
{
}
}

7
aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/AbpSerilogUniqueIdConsts.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId
{
public class AbpSerilogUniqueIdConsts
{
public const string UniqueIdPropertyName = "UniqueId";
}
}

21
aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/LINGYUN/Abp/Serilog/Enrichers/UniqueId/UniqueIdEnricher.cs

@ -0,0 +1,21 @@
using LINGYUN.Abp.IdGenerator;
using LINGYUN.Abp.IdGenerator.Snowflake;
using Serilog.Core;
using Serilog.Events;
namespace LINGYUN.Abp.Serilog.Enrichers.UniqueId
{
public class UniqueIdEnricher : ILogEventEnricher
{
private readonly static IDistributedIdGenerator _distributedIdGenerator
= SnowflakeIdGenerator.Create(new SnowflakeIdOptions());
public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
logEvent.AddOrUpdateProperty(
propertyFactory.CreateProperty(
AbpSerilogUniqueIdConsts.UniqueIdPropertyName,
_distributedIdGenerator.Create()));
}
}
}

16
aspnet-core/modules/logging/LINGYUN.Abp.Serilog.Enrichers.UniqueId/Serilog/UniqueIdLoggerConfigurationExtensions.cs

@ -0,0 +1,16 @@
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using Serilog.Configuration;
using System;
namespace Serilog
{
public static class UniqueIdLoggerConfigurationExtensions
{
public static LoggerConfiguration WithUniqueId(
this LoggerEnrichmentConfiguration enrichmentConfiguration)
{
if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration));
return enrichmentConfiguration.With<UniqueIdEnricher>();
}
}
}

79
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/BackendAdminHttpApiHostModule.cs

@ -11,6 +11,7 @@ using LINGYUN.Abp.Logging.Serilog.Elasticsearch;
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.SettingManagement;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Abp.TenantManagement;
@ -40,43 +41,44 @@ using Volo.Abp.TenantManagement.EntityFrameworkCore;
namespace LY.MicroService.BackendAdmin;
[DependsOn(
typeof(AbpSerilogEnrichersApplicationModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpLoggingSerilogElasticsearchModule),
typeof(AbpAuditLoggingElasticsearchModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpSettingManagementApplicationModule),
typeof(AbpSettingManagementHttpApiModule),
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpFeatureManagementApplicationModule),
typeof(AbpFeatureManagementHttpApiModule),
typeof(AbpFeatureManagementClientModule),
typeof(AbpAuditingApplicationModule),
typeof(AbpAuditingHttpApiModule),
typeof(AbpTenantManagementApplicationModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpEntityFrameworkCoreMySQLModule),
typeof(AbpIdentityEntityFrameworkCoreModule),// 用户角色权限需要引用包
typeof(AbpIdentityServerEntityFrameworkCoreModule), // 客户端权限需要引用包
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementDomainIdentityServerModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpCAPEventBusModule),
typeof(AbpAliyunSmsModule),
typeof(AbpDbFinderMultiTenancyModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpLocalizationCultureMapModule),
typeof(AbpAutofacModule)
)]
typeof(AbpSerilogEnrichersApplicationModule),
typeof(AbpSerilogEnrichersUniqueIdModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpLoggingSerilogElasticsearchModule),
typeof(AbpAuditLoggingElasticsearchModule),
typeof(AbpAspNetCoreMvcUiMultiTenancyModule),
typeof(AbpSettingManagementApplicationModule),
typeof(AbpSettingManagementHttpApiModule),
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpPermissionManagementHttpApiModule),
typeof(AbpFeatureManagementApplicationModule),
typeof(AbpFeatureManagementHttpApiModule),
typeof(AbpFeatureManagementClientModule),
typeof(AbpAuditingApplicationModule),
typeof(AbpAuditingHttpApiModule),
typeof(AbpTenantManagementApplicationModule),
typeof(AbpTenantManagementHttpApiModule),
typeof(AbpEntityFrameworkCoreMySQLModule),
typeof(AbpIdentityEntityFrameworkCoreModule),// 用户角色权限需要引用包
typeof(AbpIdentityServerEntityFrameworkCoreModule), // 客户端权限需要引用包
typeof(AbpTenantManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementDomainIdentityServerModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpCAPEventBusModule),
typeof(AbpAliyunSmsModule),
typeof(AbpDbFinderMultiTenancyModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpLocalizationCultureMapModule),
typeof(AbpAutofacModule)
)]
public partial class BackendAdminHttpApiHostModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
@ -89,8 +91,9 @@ public partial class BackendAdminHttpApiHostModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAlwaysAllowAuthorization();
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = hostingEnvironment.BuildConfiguration();
var configuration = context.Services.GetConfiguration();
ConfigureDbContext();
ConfigureJsonSerializer();

1
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/LY.MicroService.BackendAdmin.HttpApi.Host.csproj

@ -62,6 +62,7 @@
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Logging.Serilog.Elasticsearch\LINGYUN.Abp.Logging.Serilog.Elasticsearch.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj" />

2
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Properties/launchSettings.json

@ -14,7 +14,7 @@
"launchBrowser": false,
"applicationUrl": "http://127.0.0.1:30010",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
}

2
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/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",

1
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/LY.MicroService.LocalizationManagement.HttpApi.Host.csproj

@ -43,6 +43,7 @@
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.ExceptionHandling.Emailing\LINGYUN.Abp.ExceptionHandling.Emailing.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.Application\LINGYUN.Abp.LocalizationManagement.Application.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.HttpApi\LINGYUN.Abp.LocalizationManagement.HttpApi.csproj" />

2
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),

2
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",

1
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/LY.MicroService.PlatformManagement.HttpApi.Host.csproj

@ -50,6 +50,7 @@
<ProjectReference Include="..\..\modules\features\LINGYUN.Abp.Features.Client\LINGYUN.Abp.Features.Client.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.Aliyun\LINGYUN.Abp.OssManagement.Aliyun.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.OssManagement.Application\LINGYUN.Abp.OssManagement.Application.csproj" />

72
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)

2
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",

1
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/LY.MicroService.RealtimeMessage.HttpApi.Host.csproj

@ -54,6 +54,7 @@
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Notifications.Sms\LINGYUN.Abp.Notifications.Sms.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\message\LINGYUN.Abp.MessageService.Application\LINGYUN.Abp.MessageService.Application.csproj" />
<ProjectReference Include="..\..\modules\message\LINGYUN.Abp.MessageService.EntityFrameworkCore\LINGYUN.Abp.MessageService.EntityFrameworkCore.csproj" />

2
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),

2
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",

1
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/LY.MicroService.WorkflowManagement.HttpApi.Host.csproj

@ -43,6 +43,7 @@
<ProjectReference Include="..\..\modules\tenants\LINGYUN.Abp.MultiTenancy.DbFinder\LINGYUN.Abp.MultiTenancy.DbFinder.csproj" />
<ProjectReference Include="..\..\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\oss-management\LINGYUN.Abp.BlobStoring.OssManagement\LINGYUN.Abp.BlobStoring.OssManagement.csproj" />
<ProjectReference Include="..\..\modules\workflow\LINGYUN.Abp.WorkflowCore.Components\LINGYUN.Abp.WorkflowCore.Components.csproj" />

62
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)

2
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",

56
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)

1
aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/LY.MicroService.identityServer.HttpApi.Host.csproj

@ -68,6 +68,7 @@
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.HttpApi\LINGYUN.Abp.Identity.HttpApi.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\tenants\LINGYUN.Abp.MultiTenancy.DbFinder\LINGYUN.Abp.MultiTenancy.DbFinder.csproj" />
</ItemGroup>

2
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",

58
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";

1
aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj

@ -58,6 +58,7 @@
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\tenants\LINGYUN.Abp.MultiTenancy.DbFinder\LINGYUN.Abp.MultiTenancy.DbFinder.csproj" />
<ProjectReference Include="..\..\modules\tenants\LINGYUN.Abp.MultiTenancy\LINGYUN.Abp.MultiTenancy.csproj" />
</ItemGroup>

2
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",

51
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/LINGYUN.MicroService.Internal.ApiGateway.sln

@ -1,21 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.MicroService.Internal.ApiGateway", "src\LINGYUN.MicroService.Internal.ApiGateway\LINGYUN.MicroService.Internal.ApiGateway.csproj", "{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E8067AED-2B6E-4134-AAF8-9101457D709A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2} = {E8067AED-2B6E-4134-AAF8-9101457D709A}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31919.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.MicroService.Internal.ApiGateway", "src\LINGYUN.MicroService.Internal.ApiGateway\LINGYUN.MicroService.Internal.ApiGateway.csproj", "{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E8067AED-2B6E-4134-AAF8-9101457D709A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{00A2F7A3-BEC3-48F4-A91C-5A336C32A5D2} = {E8067AED-2B6E-4134-AAF8-9101457D709A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {972464AB-1B23-4D87-89A2-13271E1873B9}
EndGlobalSection
EndGlobal

9
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/InternalApiGatewayModule.cs

@ -1,5 +1,5 @@
using LINGYUN.Abp.AspNetCore.HttpOverrides;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@ -19,9 +19,9 @@ namespace LINGYUN.MicroService.Internal.ApiGateway
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpSerilogEnrichersApplicationModule),
typeof(AbpSerilogEnrichersUniqueIdModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAspNetCoreHttpOverridesModule)
typeof(AbpAspNetCoreSerilogModule)
)]
public partial class InternalApiGatewayModule : AbpModule
{
@ -53,7 +53,6 @@ namespace LINGYUN.MicroService.Internal.ApiGateway
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
app.UseForwardedHeaders();
app.UseAuditing();
app.UseStaticFiles();
app.UseRouting();

2
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/LINGYUN.MicroService.Internal.ApiGateway.csproj

@ -31,9 +31,9 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
</ItemGroup>
</Project>

2
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/appsettings.json

@ -19,7 +19,7 @@
"Microsoft": "Warning"
}
},
"Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName" ],
"Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId", "WithEnvironmentName", "WithMachineName", "WithApplicationName", "WithUniqueId" ],
"WriteTo": [
{
"Name": "Console",

Loading…
Cancel
Save