Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Latest commit

 

History

History
34 lines (27 loc) · 1.05 KB

README.md

File metadata and controls

34 lines (27 loc) · 1.05 KB

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");