6 changed files with 227 additions and 121 deletions
@ -1,112 +1,143 @@ |
|||||
{ |
{ |
||||
"App": { |
"App": { |
||||
"TrackingEntitiesChanged": true, |
"TrackingEntitiesChanged": true, |
||||
"SelfUrl": "http://localhost:44385/" |
"SelfUrl": "http://localhost:44385/" |
||||
}, |
}, |
||||
"ConnectionStrings": { |
"ConnectionStrings": { |
||||
"Default": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
"Default": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
||||
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456", |
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456", |
||||
"AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456", |
"AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456", |
||||
"AbpTenantManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
"AbpTenantManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
||||
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
||||
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456", |
||||
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456" |
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456" |
||||
}, |
}, |
||||
"Location": { |
"Logging": { |
||||
"Baidu": { |
"Serilog": { |
||||
"AccessKey": "你自己的百度地图WebAPI Key", |
"Elasticsearch": { |
||||
"ExtensionsRoad": true, |
"IndexFormat": "linyun.abp.logging-{0:yyyy.MM.dd}" |
||||
"ExtensionsTown": true, |
} |
||||
"ExtensionsPoi": "1", |
} |
||||
"VisableErrorToClient": true |
}, |
||||
}, |
"AuditLogging": { |
||||
"Tencent": { |
"Elasticsearch": { |
||||
"AccessKey": "你自己的腾讯地图WebAPI Key", |
"IndexPrefix": "lingyun.abp.auditing" |
||||
"SecretKey": "你自己的腾讯地图WebAPI SecretKey Key, 不填的话不计算签名", |
} |
||||
"VisableErrorToClient": true |
}, |
||||
} |
"Elasticsearch": { |
||||
}, |
"NodeUris": "http://localhost:9200" |
||||
"CAP": { |
}, |
||||
"EventBus": { |
"Location": { |
||||
"DefaultGroupName": "BackendAdmin", |
"Baidu": { |
||||
"Version": "v1", |
"AccessKey": "你自己的百度地图WebAPI Key", |
||||
"FailedRetryInterval": 300, |
"ExtensionsRoad": true, |
||||
"FailedRetryCount": 10 |
"ExtensionsTown": true, |
||||
}, |
"ExtensionsPoi": "1", |
||||
"RabbitMQ": { |
"VisableErrorToClient": true |
||||
"HostName": "Your RabbitMQ server connection address", |
}, |
||||
"Port": 5672, |
"Tencent": { |
||||
"UserName": "Your RabbitMQ server connection user", |
"AccessKey": "你自己的腾讯地图WebAPI Key", |
||||
"Password": "Your RabbitMQ server connection user password", |
"SecretKey": "你自己的腾讯地图WebAPI SecretKey Key, 不填的话不计算签名", |
||||
"ExchangeName": "The name of your RabbitMQ server switch", |
"VisableErrorToClient": true |
||||
"VirtualHost": "Name of your RabbitMQ server VirtualHost" |
} |
||||
} |
}, |
||||
}, |
"CAP": { |
||||
"Redis": { |
"EventBus": { |
||||
"Configuration": "127.0.0.1", |
"DefaultGroupName": "BackendAdmin", |
||||
"InstanceName": "LINGYUN.AbpApplication", |
"Version": "v1", |
||||
"DefaultDatabase": 10 |
"FailedRetryInterval": 300, |
||||
}, |
"FailedRetryCount": 10 |
||||
"AuthServer": { |
}, |
||||
"Authority": "http://localhost:44385/", |
"RabbitMQ": { |
||||
"ApiName": "lingyun-abp-application" |
"HostName": "Your RabbitMQ server connection address", |
||||
}, |
"Port": 5672, |
||||
"Serilog": { |
"UserName": "Your RabbitMQ server connection user", |
||||
"MinimumLevel": { |
"Password": "Your RabbitMQ server connection user password", |
||||
"Default": "Debug", |
"ExchangeName": "The name of your RabbitMQ server switch", |
||||
"Override": { |
"VirtualHost": "Name of your RabbitMQ server VirtualHost" |
||||
"Microsoft.EntityFrameworkCore": "Debug", |
} |
||||
"System": "Warning", |
}, |
||||
"Microsoft": "Warning" |
"Redis": { |
||||
} |
"Configuration": "127.0.0.1", |
||||
}, |
"InstanceName": "LINGYUN.AbpApplication", |
||||
"Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId" ], |
"DefaultDatabase": 10 |
||||
"WriteTo": [ |
}, |
||||
{ |
"AuthServer": { |
||||
"Name": "File", |
"Authority": "http://localhost:44385/", |
||||
"Args": { |
"ApiName": "lingyun-abp-application" |
||||
"path": "Logs/Debug-.log", |
}, |
||||
"restrictedToMinimumLevel": "Debug", |
"Serilog": { |
||||
"rollingInterval": "Day", |
"MinimumLevel": { |
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
"Default": "Debug", |
||||
} |
"Override": { |
||||
}, |
"Microsoft.EntityFrameworkCore": "Debug", |
||||
{ |
"System": "Warning", |
||||
"Name": "File", |
"Microsoft": "Warning" |
||||
"Args": { |
} |
||||
"path": "Logs/Info-.log", |
}, |
||||
"restrictedToMinimumLevel": "Information", |
"Enrich": [ "FromLogContext", "WithProcessId", "WithThreadId" ], |
||||
"rollingInterval": "Day", |
"WriteTo": [ |
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
{ |
||||
} |
"Name": "Console", |
||||
}, |
"Args": { |
||||
{ |
"restrictedToMinimumLevel": "Debug", |
||||
"Name": "File", |
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
||||
"Args": { |
} |
||||
"path": "Logs/Warn-.log", |
}, |
||||
"restrictedToMinimumLevel": "Warning", |
{ |
||||
"rollingInterval": "Day", |
"Name": "Elasticsearch", |
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
"Args": { |
||||
} |
"nodeUris": "http://localhost:9200", |
||||
}, |
"indexFormat": "linyun.abp.logging-{0:yyyy.MM.dd}", |
||||
{ |
"autoRegisterTemplate": true, |
||||
"Name": "File", |
"autoRegisterTemplateVersion": "ESv7" |
||||
"Args": { |
} |
||||
"path": "Logs/Error-.log", |
}, |
||||
"restrictedToMinimumLevel": "Error", |
{ |
||||
"rollingInterval": "Day", |
"Name": "File", |
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
"Args": { |
||||
} |
"path": "Logs/Debug-.log", |
||||
}, |
"restrictedToMinimumLevel": "Debug", |
||||
{ |
"rollingInterval": "Day", |
||||
"Name": "File", |
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
||||
"Args": { |
} |
||||
"path": "Logs/Fatal-.log", |
}, |
||||
"restrictedToMinimumLevel": "Fatal", |
{ |
||||
"rollingInterval": "Day", |
"Name": "File", |
||||
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
"Args": { |
||||
} |
"path": "Logs/Info-.log", |
||||
} |
"restrictedToMinimumLevel": "Information", |
||||
] |
"rollingInterval": "Day", |
||||
} |
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
||||
} |
} |
||||
|
}, |
||||
|
{ |
||||
|
"Name": "File", |
||||
|
"Args": { |
||||
|
"path": "Logs/Warn-.log", |
||||
|
"restrictedToMinimumLevel": "Warning", |
||||
|
"rollingInterval": "Day", |
||||
|
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
"Name": "File", |
||||
|
"Args": { |
||||
|
"path": "Logs/Error-.log", |
||||
|
"restrictedToMinimumLevel": "Error", |
||||
|
"rollingInterval": "Day", |
||||
|
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
"Name": "File", |
||||
|
"Args": { |
||||
|
"path": "Logs/Fatal-.log", |
||||
|
"restrictedToMinimumLevel": "Fatal", |
||||
|
"rollingInterval": "Day", |
||||
|
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{SourceContext}] [{ProcessId}] [{ThreadId}] - {Message:lj}{NewLine}{Exception}" |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
|||||
@ -0,0 +1,38 @@ |
|||||
|
# LINGYUN.Abp.AuditLogging.Elasticsearch |
||||
|
|
||||
|
审计模块 Elasticsearch 实现 |
||||
|
|
||||
|
ElasticsearchAuditLogManager 实现了 IAuditLogManager, 审计日志由ES管理 |
||||
|
ElasticsearchSecurityLogManager 实现了 ISecurityLogManager, 安全日志由ES管理 |
||||
|
|
||||
|
## 模块引用 |
||||
|
|
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpAuditLoggingElasticsearchModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 配置项 |
||||
|
|
||||
|
* AbpAuditLoggingElasticsearchOptions.IndexPrefix 索引前缀, 默认 auditlogging |
||||
|
|
||||
|
## 注意事项 |
||||
|
|
||||
|
与租户模块集成, 跨租户时将会切换索引 |
||||
|
|
||||
|
## appsettings.json |
||||
|
|
||||
|
```json |
||||
|
{ |
||||
|
"AuditLogging": { |
||||
|
"Elasticsearch": { |
||||
|
"IndexPrefix": "auditlogging" |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
``` |
||||
@ -0,0 +1,35 @@ |
|||||
|
# LINGYUN.Abp.Elasticsearch |
||||
|
|
||||
|
Abp Elasticsearch集成,提供全局唯一IElasticClient访问接口 |
||||
|
|
||||
|
## 模块引用 |
||||
|
|
||||
|
|
||||
|
```csharp |
||||
|
[DependsOn(typeof(AbpElasticsearchModule))] |
||||
|
public class YouProjectModule : AbpModule |
||||
|
{ |
||||
|
// other |
||||
|
} |
||||
|
``` |
||||
|
|
||||
|
## 配置项 |
||||
|
|
||||
|
* AbpElasticsearchOptions.FieldCamelCase 字段是否采用 camelCase 格式, 默认false |
||||
|
* AbpElasticsearchOptions.NodeUris ES端点,多个端点以,或;分隔 |
||||
|
* AbpElasticsearchOptions.TypeName 文档名称,默认_doc |
||||
|
* AbpElasticsearchOptions.ConnectionLimit 最大连接数,详情见 NEST 文档 |
||||
|
* AbpElasticsearchOptions.UserName 连接用户,详情见 NEST 文档 |
||||
|
* AbpElasticsearchOptions.Password 用户密码,详情见 NEST 文档 |
||||
|
* AbpElasticsearchOptions.ConnectionTimeout 连接超时时间,详情见 NEST 文档 |
||||
|
|
||||
|
## appsettings.json |
||||
|
|
||||
|
```json |
||||
|
{ |
||||
|
"Elasticsearch": { |
||||
|
"NodeUris": "http://localhost:9200" |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
``` |
||||
Loading…
Reference in new issue