Browse Source
Merge pull request #351 from colinin/4.4
feat(audit): log retrieval should be in reverse order by default.
pull/364/head
yx lin
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
7 additions and
7 deletions
-
aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchAuditLogManager.cs
-
aspnet-core/modules/auditing/LINGYUN.Abp.AuditLogging.Elasticsearch/LINGYUN/Abp/AuditLogging/Elasticsearch/ElasticsearchSecurityLogManager.cs
-
aspnet-core/modules/logging/LINGYUN.Abp.Logging.Serilog.Elasticsearch/LINGYUN/Abp/AuditLogging/Serilog/Elasticsearch/SerilogElasticsearchLoggingManager.cs
|
|
|
@ -113,8 +113,8 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch |
|
|
|
{ |
|
|
|
var client = _clientFactory.Create(); |
|
|
|
|
|
|
|
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("desc", StringComparison.InvariantCultureIgnoreCase) |
|
|
|
? SortOrder.Descending : SortOrder.Ascending; |
|
|
|
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) |
|
|
|
? SortOrder.Ascending : SortOrder.Descending; |
|
|
|
sorting = !sorting.IsNullOrWhiteSpace() |
|
|
|
? sorting.Split()[0] |
|
|
|
: nameof(AuditLog.ExecutionTime); |
|
|
|
|
|
|
|
@ -114,8 +114,8 @@ namespace LINGYUN.Abp.AuditLogging.Elasticsearch |
|
|
|
{ |
|
|
|
var client = _clientFactory.Create(); |
|
|
|
|
|
|
|
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("desc", StringComparison.InvariantCultureIgnoreCase) |
|
|
|
? SortOrder.Descending : SortOrder.Ascending; |
|
|
|
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) |
|
|
|
? SortOrder.Ascending : SortOrder.Descending; |
|
|
|
sorting = !sorting.IsNullOrWhiteSpace() |
|
|
|
? sorting.Split()[0] |
|
|
|
: nameof(SecurityLog.CreationTime); |
|
|
|
|
|
|
|
@ -148,8 +148,8 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch |
|
|
|
{ |
|
|
|
var client = _clientFactory.Create(); |
|
|
|
|
|
|
|
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("desc", StringComparison.InvariantCultureIgnoreCase) |
|
|
|
? SortOrder.Descending : SortOrder.Ascending; |
|
|
|
var sortOrder = !sorting.IsNullOrWhiteSpace() && sorting.EndsWith("asc", StringComparison.InvariantCultureIgnoreCase) |
|
|
|
? SortOrder.Ascending : SortOrder.Descending; |
|
|
|
sorting = sorting ?? "timestamp"; |
|
|
|
|
|
|
|
var querys = BuildQueryDescriptor( |
|
|
|
@ -218,7 +218,7 @@ namespace LINGYUN.Abp.Logging.Serilog.Elasticsearch |
|
|
|
} |
|
|
|
if (level.HasValue) |
|
|
|
{ |
|
|
|
querys.Add((log) => log.Term((q) => q.Field(f => f.Level.Suffix("keyword")).Value(level))); |
|
|
|
querys.Add((log) => log.Term((q) => q.Field(f => f.Level.Suffix("keyword")).Value(level.ToString()))); |
|
|
|
} |
|
|
|
if (!machineName.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
|