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