btastic / AM.Extensions.Logging.ElasticSearch

Microsoft.Extensions.Logging compatible logger posting to ElasticSearch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AM.Extensions.Logging.ElasticSearch

Microsoft.Extensions.Logging compatible logger posting to ElasticSearch

.NET Core - master

ElasticSearch Logger is a ILogger based logger which submits events and data to ElasticSearch making them viewable with Kibana

nuget downloads nuget version

Getting Started

Install the package from nuget.org https://www.nuget.org/packages/AM.Extensions.Logging.ElasticSearch

Install-Package AM.Extensions.Logging.ElasticSearch
 .AddLogging(builder =>
                {
                    builder
                        .AddConfiguration(loggingConfiguration.GetSection("Logging"))
                        .AddElasticSearch(options =>
                        {
                            options.ElasticsearchEndpoint = new Uri(@"http://localhost:9200/");
                            //options.IndexName = "trace";
                        });

Elasticsearch logging posting using a configurable index prefix -YYYY-MM-DD-HH the default prefix is "trace"

see https://github.com/amccool/AM.Elasticsearch.TraceListener for setup of Elasticsearch index via kibana

PR's welcome

About

Microsoft.Extensions.Logging compatible logger posting to ElasticSearch

License:MIT License


Languages

Language:C# 100.0%