You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.4 KiB
1.4 KiB
LINGYUN.Abp.Logging.Serilog.Elasticsearch
简体中文 | English
Elasticsearch implementation of the ILoggingManager interface, retrieving log information from Elasticsearch.
Module Dependencies
[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
-
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
-
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
{
"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}".