6 changed files with 164 additions and 9 deletions
@ -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 |
|||
@ -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 |
|||
@ -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}". |
|||
Loading…
Reference in new issue