MedAnd / slab-sinks

Semantic Logging Application Block Sinks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slab-sinks

This project contains Semantic Logging Application Block (SLAB) sinks to persist application events published to ETW and consumed by SLAB.

Sinks

  • Elasticsearch (Where else would you write events?)

##Elasticsearch Sink A sink to write Semantic Logging Application Block (SLAB) events to Elasticsearch.

###0 Create an event source Create a class derived from EventSource

You could also use EventSourceProxy

###1 Install NuGet

Install-Package EnterpriseLibrary.SemanticLogging.Elasticsearch

###2 Create a listener and enable events

var listener = new ObservableEventListener();

listener.EnableEvents(CommonEventSource.Log, EventLevel.LogAlways, ~EventKeywords.None);

###3 Send events to Elasticsearch

listener.LogToElasticsearch(
    Environment.MachineName,
    "http://localhost:9200",
    "slab",
    "mylogs");

About

Semantic Logging Application Block Sinks

License:Apache License 2.0


Languages

Language:C# 100.0%