From 48ef1b6c0601f0e8bdbc37ab450526e110ccca8f Mon Sep 17 00:00:00 2001 From: feijie Date: Tue, 10 Dec 2024 21:39:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(docs):=20=E6=B7=BB=E5=8A=A0Elasticsearch?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../README.EN.md | 61 +++++++++++++++++++ .../README.md | 6 +- .../LINGYUN.Abp.Elasticsearch/README.EN.md | 44 +++++++++++++ .../LINGYUN.Abp.Elasticsearch/README.md | 6 +- .../README.EN.md | 50 +++++++++++++++ .../README.md | 6 +- 6 files changed, 164 insertions(+), 9 deletions(-) create mode 100644 aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.EN.md create mode 100644 aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.EN.md create mode 100644 aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.EN.md diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.EN.md b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.EN.md new file mode 100644 index 000000000..7fccd5585 --- /dev/null +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.EN.md @@ -0,0 +1,61 @@ +# LINGYUN.Abp.AuditLogging.Elasticsearch + +[简体中文](./README.md) | English + +Elasticsearch implementation for the audit logging module. + +## Features + +* ElasticsearchAuditLogManager - Implements IAuditLogManager, managing audit logs with Elasticsearch +* ElasticsearchSecurityLogManager - Implements ISecurityLogManager, managing security logs with Elasticsearch + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpAuditLoggingElasticsearchModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Options + +* AbpAuditLoggingElasticsearchOptions.IndexPrefix - Index prefix, default is 'auditlogging' +* AbpAuditLoggingElasticsearchOptions.IndexSettings - Elasticsearch index settings + +## Multi-tenancy Support + +When integrated with the tenant module, the index will switch based on the tenant: +- For tenant-specific data: `{prefix}-{index}-{tenantId}` +- For host data: `{prefix}-{index}` + +## appsettings.json + +```json +{ + "AuditLogging": { + "Elasticsearch": { + "IndexPrefix": "auditlogging" + } + } +} +``` + +## Features + +1. Audit Log Management + - Store and retrieve audit logs in Elasticsearch + - Support for entity change tracking + - Flexible querying with various filters + - Support for extra properties + +2. Security Log Management + - Store and retrieve security logs in Elasticsearch + - Support for security-related events tracking + - Comprehensive querying capabilities + +3. Index Management + - Automatic index initialization + - Support for custom index settings + - Multi-tenant index isolation diff --git a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md index 3da5f3174..568ac8e03 100644 --- a/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md +++ b/aspnet-core/framework/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/README.md @@ -1,5 +1,7 @@ # LINGYUN.Abp.AuditLogging.Elasticsearch +简体中文 | [English](./README.EN.md) + 审计模块 Elasticsearch 实现 ElasticsearchAuditLogManager 实现了 IAuditLogManager, 审计日志由ES管理 @@ -33,6 +35,4 @@ public class YouProjectModule : AbpModule "IndexPrefix": "auditlogging" } } -} - -``` \ No newline at end of file +} \ No newline at end of file diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.EN.md b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.EN.md new file mode 100644 index 000000000..23fd47947 --- /dev/null +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.EN.md @@ -0,0 +1,44 @@ +# LINGYUN.Abp.Elasticsearch + +[简体中文](./README.md) | English + +Abp Elasticsearch integration module, providing a global singleton IElasticClient interface for access. + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpElasticsearchModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Options + +* AbpElasticsearchOptions.FieldCamelCase Whether fields use camelCase format, default is false +* AbpElasticsearchOptions.NodeUris ES endpoints, multiple endpoints separated by , or ; +* AbpElasticsearchOptions.TypeName Document type name, default is _doc +* AbpElasticsearchOptions.ConnectionLimit Maximum connection limit, see NEST documentation for details +* AbpElasticsearchOptions.UserName Connection username, see NEST documentation for details +* AbpElasticsearchOptions.Password User password, see NEST documentation for details +* AbpElasticsearchOptions.ConnectionTimeout Connection timeout, see NEST documentation for details + +## appsettings.json + +```json +{ + "Elasticsearch": { + "NodeUris": "http://localhost:9200" + } +} +``` + +## Features + +* Provides a global singleton IElasticClient interface for unified Elasticsearch access +* Supports multiple node configurations for cluster deployment +* Supports basic authentication +* Configurable field naming convention (camelCase) +* Customizable connection settings including timeout and connection limits +* Compatible with NEST client features diff --git a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md index 240b6b431..fdaa94153 100644 --- a/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md +++ b/aspnet-core/framework/elasticsearch/LINGYUN.Abp.Elasticsearch/README.md @@ -1,5 +1,7 @@ # LINGYUN.Abp.Elasticsearch +简体中文 | [English](./README.EN.md) + Abp Elasticsearch集成,提供全局唯一IElasticClient访问接口 ## 模块引用 @@ -30,6 +32,4 @@ public class YouProjectModule : AbpModule "Elasticsearch": { "NodeUris": "http://localhost:9200" } -} - -``` \ No newline at end of file +} \ No newline at end of file diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.EN.md b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.EN.md new file mode 100644 index 000000000..241469379 --- /dev/null +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.EN.md @@ -0,0 +1,50 @@ +# LINGYUN.Abp.Logging.Serilog.Elasticsearch + +[简体中文](./README.md) | English + +Elasticsearch implementation of the ILoggingManager interface, retrieving log information from Elasticsearch. + +## Module Dependencies + +```csharp +[DependsOn(typeof(AbpLoggingSerilogElasticsearchModule))] +public class YouProjectModule : AbpModule +{ + // other +} +``` + +## Configuration Options + +* AbpLoggingSerilogElasticsearchOptions.IndexFormat - Must match the IndexFormat in Serilog configuration, otherwise the correct index cannot be located + +## Features + +1. Log Retrieval + - Retrieve logs from Elasticsearch using ILoggingManager interface + - Support for various log levels (Debug, Information, Warning, Error, Critical) + - Automatic mapping between Serilog and Microsoft.Extensions.Logging log levels + +2. Object Mapping + - Automatic mapping of Serilog entities to application entities + - Maps SerilogException to LogException + - Maps SerilogField to LogField with unique ID support + - Maps SerilogInfo to LogInfo with proper log level conversion + +## appsettings.json + +```json +{ + "Logging": { + "Serilog": { + "Elasticsearch": { + "IndexFormat": "logstash-{0:yyyy.MM.dd}" + } + } + } +} +``` + +## Important Notes + +The IndexFormat configuration must be consistent between your Serilog settings and this module's configuration to ensure proper log retrieval. The default format is "logstash-{0:yyyy.MM.dd}". diff --git a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md index 0310e602b..13367b1c4 100644 --- a/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md +++ b/aspnet-core/framework/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/README.md @@ -1,5 +1,7 @@ # LINGYUN.Abp.Logging.Serilog.Elasticsearch +简体中文 | [English](./README.EN.md) + ILoggingManager 接口的ES实现, 从ES中检索日志信息 ## 模块引用 @@ -27,6 +29,4 @@ public class YouProjectModule : AbpModule } } } -} - -``` \ No newline at end of file +} \ No newline at end of file