SlideShare a Scribd company logo
1 of 20
Christopher Bennage
patterns & practices
microsoft.com/practices
Semantic Logging
Avoiding the Log Chaos
• No real structure
• What’s in there?
• Sheer number of files & types of logs is
overwhelming
• Hard to consume/automate
• Subject to compatibility/inconsistencies.
Logs are Frustrating
Semantic?
Unstructured Log
An example
176 [main] INFO examples.Sort - Populating an array of 2 elements in reverse order.
225 [main] INFO examples.SortAlgo - Entered the sort method.
262 [main] DEBUG SortAlgo.OUTER i=1 - Outer loop.
276 [main] DEBUG SortAlgo.SWAP i=1 j=0 - Swapping intArray[0] = 1 and intArray[1] = 0
290 [main] DEBUG SortAlgo.OUTER i=0 - Outer loop.
304 [main] INFO SortAlgo.DUMP - Dump of integer array:
317 [main] INFO SortAlgo.DUMP - Element [0] = 0
331 [main] INFO SortAlgo.DUMP - Element [1] = 1
343 [main] INFO examples.Sort - The next log statement should be an error message.
346 [main] ERROR SortAlgo.DUMP - Tried to dump an uninitialized array.
467 [main] INFO examples.Sort - Exiting main method.
Structured Log
An example using Azure
Query by payload argument
• Logging cannot be just a checkmark of doing something.
• You have to think about consumption and purpose.
• Allow appropriate decisions to be made at appropriate time,
explicitly separating:
•WHAT to log
•WHEN to log it
•WHERE to log
We are on a mission
Changing the way people think about logging
demo >> EventSource & SLAB in-process
Technologies at Play
Event Tracing
for Windows
(ETW)
• Native to Windows platform
• Great performance & OK diagnostic tooling
• Historically hard to publish events
EventSource
class
• Introduced in .NET Framework 4.5
• Meant to ease authoring experience
• Extensible but supports ETW-only out of the box
Semantic
Logging
Application
Block (SLAB)
• Provides several destinations for events published with
EventSource
• Does not require any knowledge in ETW
• Additional tooling support for authoring events
Technologies at Play
• Sinks
• Formatters
• Out-Of-Process Service
• Event Source Analyzer
• Observable Event Listener
Sinks
Features of SLAB
• Azure Tables
• SQL Database
• Flat file
• Rolling flat file
• Console
• Elasticsearch
Sinks
Features of SLAB
• JSON
• XML
• Natural (plain-text)
Formatters
Features of SLAB
• Hosted as a Windows Service or console
• All sinks are supported
• Configuration-driven with support for re-configuration
Benefits
•Increased fault tolerance in case of application crash
•Monitored application does not reference SLAB
•Can monitor multiple processes from a single service.
•Moves the logging overhead from the application to
a separate process (but the overhead is still there!)
Out of Process Service
Features of SLAB
// can be run in a unit test
TestMethod
public void
EventSourceAnalyzer AExpenseEvents
// will verify correctness of events
// this example has inconsistent ID and order of parameters
Event
public void int string int
this
Event Source Analyzer
Features of SLAB
• Event listener is IObservable.
• Event sinks are IObservers.
• Can leverage Reactive Extensions (Rx) to
filter, pre-process or transform the event
stream before it’s persisted.
Based on Observable
Features of SLAB
demo >> Flush on Error/Alarm Flood Throttle
• Support for ActivityIds
• Ability to capture events from source not publicly available
• Sink for Elasticsearch
• Performance improvements
• Improved extensibility story
• Minor bug fixes
http://aka.ms/slab1_1
SLAB 1.1
What’s Coming Next Now
• Evaluate SLAB and adopt it
(search for “slab” in NuGet).
• Read the docs - aka.ms/slab
• Practice the Hands-on Labs &
Quickstarts - aka.ms/el6hols
• Engage with us by providing
feedback and/or submitting contributions - slab.codeplex.com
Call to Action
• http://slab.codeplex.com
• http://aka.ms/slab
• http://entlib.codeplex.com
Resources
microsoft.com/practices
• @bennage
• dev.bennage.com
Вопросы?
Christopher Bennage
patterns & practices
Microsoft
christopher.bennage@microsoft.com

More Related Content

What's hot

Getting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchGetting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchPeter Steenbergen
 
Slick – the modern way to access your Data
Slick – the modern way to access your DataSlick – the modern way to access your Data
Slick – the modern way to access your DataJochen Huelss
 
Akka lsug skills matter
Akka lsug skills matterAkka lsug skills matter
Akka lsug skills matterSkills Matter
 
Project Orleans - Actor Model framework
Project Orleans - Actor Model frameworkProject Orleans - Actor Model framework
Project Orleans - Actor Model frameworkNeil Mackenzie
 
Actors Set the Stage for Project Orleans
Actors Set the Stage for Project OrleansActors Set the Stage for Project Orleans
Actors Set the Stage for Project Orleanscjmyers
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений БобровFwdays
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudAnshum Gupta
 
What's New in Apache Solr 4.10
What's New in Apache Solr 4.10What's New in Apache Solr 4.10
What's New in Apache Solr 4.10Anshum Gupta
 
A Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft OrleansA Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft OrleansUri Goldstein
 
Apache Solr 5.0 and beyond
Apache Solr 5.0 and beyondApache Solr 5.0 and beyond
Apache Solr 5.0 and beyondAnshum Gupta
 
Spark UDFs are EviL, Catalyst to the rEsCue!
Spark UDFs are EviL, Catalyst to the rEsCue!Spark UDFs are EviL, Catalyst to the rEsCue!
Spark UDFs are EviL, Catalyst to the rEsCue!Adi Polak
 
Scala.js for large and complex frontend apps
Scala.js for large and complex frontend appsScala.js for large and complex frontend apps
Scala.js for large and complex frontend appsOtto Chrons
 
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...Codemotion
 
Ease of use in Apache Solr
Ease of use in Apache SolrEase of use in Apache Solr
Ease of use in Apache SolrAnshum Gupta
 
Introduction to Apache solr
Introduction to Apache solrIntroduction to Apache solr
Introduction to Apache solrKnoldus Inc.
 
ElasticSearch in Production: lessons learned
ElasticSearch in Production: lessons learnedElasticSearch in Production: lessons learned
ElasticSearch in Production: lessons learnedBeyondTrees
 
Coding for production
Coding for productionCoding for production
Coding for productionjehiah
 
Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1YI-CHING WU
 

What's hot (20)

Getting started with Laravel & Elasticsearch
Getting started with Laravel & ElasticsearchGetting started with Laravel & Elasticsearch
Getting started with Laravel & Elasticsearch
 
Slick – the modern way to access your Data
Slick – the modern way to access your DataSlick – the modern way to access your Data
Slick – the modern way to access your Data
 
Laravel and SOLR
Laravel and SOLRLaravel and SOLR
Laravel and SOLR
 
Akka lsug skills matter
Akka lsug skills matterAkka lsug skills matter
Akka lsug skills matter
 
Project Orleans - Actor Model framework
Project Orleans - Actor Model frameworkProject Orleans - Actor Model framework
Project Orleans - Actor Model framework
 
Elastic search
Elastic searchElastic search
Elastic search
 
Actors Set the Stage for Project Orleans
Actors Set the Stage for Project OrleansActors Set the Stage for Project Orleans
Actors Set the Stage for Project Orleans
 
"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров"Walk in a distributed systems park with Orleans" Евгений Бобров
"Walk in a distributed systems park with Orleans" Евгений Бобров
 
Best practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloud
 
What's New in Apache Solr 4.10
What's New in Apache Solr 4.10What's New in Apache Solr 4.10
What's New in Apache Solr 4.10
 
A Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft OrleansA Brief Intro to Microsoft Orleans
A Brief Intro to Microsoft Orleans
 
Apache Solr 5.0 and beyond
Apache Solr 5.0 and beyondApache Solr 5.0 and beyond
Apache Solr 5.0 and beyond
 
Spark UDFs are EviL, Catalyst to the rEsCue!
Spark UDFs are EviL, Catalyst to the rEsCue!Spark UDFs are EviL, Catalyst to the rEsCue!
Spark UDFs are EviL, Catalyst to the rEsCue!
 
Scala.js for large and complex frontend apps
Scala.js for large and complex frontend appsScala.js for large and complex frontend apps
Scala.js for large and complex frontend apps
 
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
Adi Polak - Light up the Spark in Catalyst by avoiding UDFs - Codemotion Berl...
 
Ease of use in Apache Solr
Ease of use in Apache SolrEase of use in Apache Solr
Ease of use in Apache Solr
 
Introduction to Apache solr
Introduction to Apache solrIntroduction to Apache solr
Introduction to Apache solr
 
ElasticSearch in Production: lessons learned
ElasticSearch in Production: lessons learnedElasticSearch in Production: lessons learned
ElasticSearch in Production: lessons learned
 
Coding for production
Coding for productionCoding for production
Coding for production
 
Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1
 

Viewers also liked

CodeFest, июль 2012. Бережной С. — Заказчик и исполнитель
CodeFest, июль 2012. Бережной С. — Заказчик и исполнительCodeFest, июль 2012. Бережной С. — Заказчик и исполнитель
CodeFest, июль 2012. Бережной С. — Заказчик и исполнительCodeFest
 
CodeFest 2012. Аксёнов А. — Как мы разрабатываем Sphinx
CodeFest 2012. Аксёнов А. — Как мы разрабатываем SphinxCodeFest 2012. Аксёнов А. — Как мы разрабатываем Sphinx
CodeFest 2012. Аксёнов А. — Как мы разрабатываем SphinxCodeFest
 
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest
 
CodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступлениях
CodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступленияхCodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступлениях
CodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступленияхCodeFest
 
CodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджера
CodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджераCodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджера
CodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджераCodeFest
 
CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?
CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?
CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?CodeFest
 
CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0
CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0
CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0CodeFest
 
CodeFest 2012. Титов А. — Инженерный дзен. Непрерывные изменения
CodeFest 2012. Титов А. — Инженерный дзен. Непрерывные измененияCodeFest 2012. Титов А. — Инженерный дзен. Непрерывные изменения
CodeFest 2012. Титов А. — Инженерный дзен. Непрерывные измененияCodeFest
 
CodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-а
CodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-аCodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-а
CodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-аCodeFest
 
CodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процесс
CodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процессCodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процесс
CodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процессCodeFest
 
CodeFest 2012. Зимин Д. — Сквозь мобильную ОСь
CodeFest 2012. Зимин Д. — Сквозь мобильную ОСьCodeFest 2012. Зимин Д. — Сквозь мобильную ОСь
CodeFest 2012. Зимин Д. — Сквозь мобильную ОСьCodeFest
 
CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!
CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!
CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!CodeFest
 
CodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологиях
CodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологияхCodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологиях
CodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологияхCodeFest
 
CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)
CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)
CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)CodeFest
 
CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...
CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...
CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...CodeFest
 
CodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытания
CodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытанияCodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытания
CodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытанияCodeFest
 
CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!
CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!
CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!CodeFest
 
CodeFest 2014. Сибирев А. — Управление инфраструктурой под Cocaine
CodeFest 2014. Сибирев А. — Управление инфраструктурой под CocaineCodeFest 2014. Сибирев А. — Управление инфраструктурой под Cocaine
CodeFest 2014. Сибирев А. — Управление инфраструктурой под CocaineCodeFest
 
CodeFest 2014. Березкин М. — Задаём ритм продуктовой разработки
CodeFest 2014. Березкин М. — Задаём ритм продуктовой разработкиCodeFest 2014. Березкин М. — Задаём ритм продуктовой разработки
CodeFest 2014. Березкин М. — Задаём ритм продуктовой разработкиCodeFest
 

Viewers also liked (19)

CodeFest, июль 2012. Бережной С. — Заказчик и исполнитель
CodeFest, июль 2012. Бережной С. — Заказчик и исполнительCodeFest, июль 2012. Бережной С. — Заказчик и исполнитель
CodeFest, июль 2012. Бережной С. — Заказчик и исполнитель
 
CodeFest 2012. Аксёнов А. — Как мы разрабатываем Sphinx
CodeFest 2012. Аксёнов А. — Как мы разрабатываем SphinxCodeFest 2012. Аксёнов А. — Как мы разрабатываем Sphinx
CodeFest 2012. Аксёнов А. — Как мы разрабатываем Sphinx
 
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
 
CodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступлениях
CodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступленияхCodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступлениях
CodeFest 2012. Фоминых С. — Passion inside или вдохновенно о выступлениях
 
CodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджера
CodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджераCodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджера
CodeFest 2014. Лысковский А. — Семь тезисов о карьере менеджера
 
CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?
CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?
CodeFest 2012. Щербакова А. — Поколение Y, или зачем нам все это нужно?
 
CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0
CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0
CodeFest 2014. Michael Yarichuk — Обзор новой версии базы данных RavenDB 3.0
 
CodeFest 2012. Титов А. — Инженерный дзен. Непрерывные изменения
CodeFest 2012. Титов А. — Инженерный дзен. Непрерывные измененияCodeFest 2012. Титов А. — Инженерный дзен. Непрерывные изменения
CodeFest 2012. Титов А. — Инженерный дзен. Непрерывные изменения
 
CodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-а
CodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-аCodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-а
CodeFest, июль 2012. — Селиховкин И. 3 счастливых ПМ-а
 
CodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процесс
CodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процессCodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процесс
CodeFest 2012. Белов С. — Пентест на стероидах. Автоматизируем процесс
 
CodeFest 2012. Зимин Д. — Сквозь мобильную ОСь
CodeFest 2012. Зимин Д. — Сквозь мобильную ОСьCodeFest 2012. Зимин Д. — Сквозь мобильную ОСь
CodeFest 2012. Зимин Д. — Сквозь мобильную ОСь
 
CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!
CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!
CodeFest 2012. Зинченко Т. — Практики тест-дизайна: разделяй и властвуй!
 
CodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологиях
CodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологияхCodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологиях
CodeFest, июль 2012. Бугаев Л. — Запуск продукта в мобильных технологиях
 
CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)
CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)
CodeFest 2012. Капустинский А. — Рецепт пробок от 2ГИС (блиц-доклад)
 
CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...
CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...
CodeFest 2012. Гладкий Д. — Практика применения MPS на примере проекта «Mobil...
 
CodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытания
CodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытанияCodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытания
CodeFest 2012. Курносова Т. и Баяндин А. — Selenium2: полевые испытания
 
CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!
CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!
CodeFest 2012. Львова М. — Корпоративная культура — это про Любовь!
 
CodeFest 2014. Сибирев А. — Управление инфраструктурой под Cocaine
CodeFest 2014. Сибирев А. — Управление инфраструктурой под CocaineCodeFest 2014. Сибирев А. — Управление инфраструктурой под Cocaine
CodeFest 2014. Сибирев А. — Управление инфраструктурой под Cocaine
 
CodeFest 2014. Березкин М. — Задаём ритм продуктовой разработки
CodeFest 2014. Березкин М. — Задаём ритм продуктовой разработкиCodeFest 2014. Березкин М. — Задаём ритм продуктовой разработки
CodeFest 2014. Березкин М. — Задаём ритм продуктовой разработки
 

Similar to CodeFest 2014. Christopher Bennage — Semantic Logging. Avoiding the log chaos

SQL Server Worst Practices - EN
SQL Server Worst Practices - ENSQL Server Worst Practices - EN
SQL Server Worst Practices - ENGianluca Sartori
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMOrtus Solutions, Corp
 
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedInML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedInEing Ong
 
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with Splunk
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with SplunkSplunkLive! Zürich 2014 Beginner Workshop: Getting started with Splunk
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with SplunkGeorg Knon
 
Campus days 2013 - Instrumentation
Campus days 2013 - InstrumentationCampus days 2013 - Instrumentation
Campus days 2013 - InstrumentationAnders Lybecker
 
ITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cbormITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cbormOrtus Solutions, Corp
 
Professional SQL for Developers
Professional SQL for DevelopersProfessional SQL for Developers
Professional SQL for DevelopersPaul Irwin
 
Getting Started with Splunk Break out Session
Getting Started with Splunk Break out SessionGetting Started with Splunk Break out Session
Getting Started with Splunk Break out SessionGeorg Knon
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersJonathan Levin
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonTerry Bunio
 
Database development unit test with tSQLt
Database development unit test with tSQLtDatabase development unit test with tSQLt
Database development unit test with tSQLtSergio Govoni
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017Roy Russo
 
Azure stream analytics by Nico Jacobs
Azure stream analytics by Nico JacobsAzure stream analytics by Nico Jacobs
Azure stream analytics by Nico JacobsITProceed
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with EpsilonSina Madani
 
Advanced Discussion on Cloud Formation
Advanced Discussion on Cloud FormationAdvanced Discussion on Cloud Formation
Advanced Discussion on Cloud FormationHenry Huang
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDAGEOP LTD
 

Similar to CodeFest 2014. Christopher Bennage — Semantic Logging. Avoiding the log chaos (20)

SQL Server Worst Practices - EN
SQL Server Worst Practices - ENSQL Server Worst Practices - EN
SQL Server Worst Practices - EN
 
Killing Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORMKilling Shark-Riding Dinosaurs with ORM
Killing Shark-Riding Dinosaurs with ORM
 
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedInML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
 
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with Splunk
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with SplunkSplunkLive! Zürich 2014 Beginner Workshop: Getting started with Splunk
SplunkLive! Zürich 2014 Beginner Workshop: Getting started with Splunk
 
Campus days 2013 - Instrumentation
Campus days 2013 - InstrumentationCampus days 2013 - Instrumentation
Campus days 2013 - Instrumentation
 
ITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cbormITB2017 - Slaying the ORM dragons with cborm
ITB2017 - Slaying the ORM dragons with cborm
 
introduction v4
introduction v4introduction v4
introduction v4
 
Professional SQL for Developers
Professional SQL for DevelopersProfessional SQL for Developers
Professional SQL for Developers
 
Getting Started with Splunk Break out Session
Getting Started with Splunk Break out SessionGetting Started with Splunk Break out Session
Getting Started with Splunk Break out Session
 
Tool
ToolTool
Tool
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for Developers
 
A data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madisonA data driven etl test framework sqlsat madison
A data driven etl test framework sqlsat madison
 
Database development unit test with tSQLt
Database development unit test with tSQLtDatabase development unit test with tSQLt
Database development unit test with tSQLt
 
Database Testing
Database TestingDatabase Testing
Database Testing
 
Introduction
IntroductionIntroduction
Introduction
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
 
Azure stream analytics by Nico Jacobs
Azure stream analytics by Nico JacobsAzure stream analytics by Nico Jacobs
Azure stream analytics by Nico Jacobs
 
Distributed Model Validation with Epsilon
Distributed Model Validation with EpsilonDistributed Model Validation with Epsilon
Distributed Model Validation with Epsilon
 
Advanced Discussion on Cloud Formation
Advanced Discussion on Cloud FormationAdvanced Discussion on Cloud Formation
Advanced Discussion on Cloud Formation
 
Database Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance AnalysisDatabase Fundamental Concepts- Series 1 - Performance Analysis
Database Fundamental Concepts- Series 1 - Performance Analysis
 

More from CodeFest

Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander GraebeCodeFest
 
Никита Прокопов
Никита ПрокоповНикита Прокопов
Никита ПрокоповCodeFest
 
Денис Баталов
Денис БаталовДенис Баталов
Денис БаталовCodeFest
 
Елена Гальцина
Елена ГальцинаЕлена Гальцина
Елена ГальцинаCodeFest
 
Александр Калашников
Александр КалашниковАлександр Калашников
Александр КалашниковCodeFest
 
Ирина Иванова
Ирина ИвановаИрина Иванова
Ирина ИвановаCodeFest
 
Marko Berković
Marko BerkovićMarko Berković
Marko BerkovićCodeFest
 
Денис Кортунов
Денис КортуновДенис Кортунов
Денис КортуновCodeFest
 
Александр Зимин
Александр ЗиминАлександр Зимин
Александр ЗиминCodeFest
 
Сергей Крапивенский
Сергей КрапивенскийСергей Крапивенский
Сергей КрапивенскийCodeFest
 
Сергей Игнатов
Сергей ИгнатовСергей Игнатов
Сергей ИгнатовCodeFest
 
Николай Крапивный
Николай КрапивныйНиколай Крапивный
Николай КрапивныйCodeFest
 
Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander GraebeCodeFest
 
Вадим Смирнов
Вадим СмирновВадим Смирнов
Вадим СмирновCodeFest
 
Константин Осипов
Константин ОсиповКонстантин Осипов
Константин ОсиповCodeFest
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele RialdiCodeFest
 
Максим Пугачев
Максим ПугачевМаксим Пугачев
Максим ПугачевCodeFest
 
Rene Groeschke
Rene GroeschkeRene Groeschke
Rene GroeschkeCodeFest
 
Иван Бондаренко
Иван БондаренкоИван Бондаренко
Иван БондаренкоCodeFest
 
Mete Atamel
Mete AtamelMete Atamel
Mete AtamelCodeFest
 

More from CodeFest (20)

Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander Graebe
 
Никита Прокопов
Никита ПрокоповНикита Прокопов
Никита Прокопов
 
Денис Баталов
Денис БаталовДенис Баталов
Денис Баталов
 
Елена Гальцина
Елена ГальцинаЕлена Гальцина
Елена Гальцина
 
Александр Калашников
Александр КалашниковАлександр Калашников
Александр Калашников
 
Ирина Иванова
Ирина ИвановаИрина Иванова
Ирина Иванова
 
Marko Berković
Marko BerkovićMarko Berković
Marko Berković
 
Денис Кортунов
Денис КортуновДенис Кортунов
Денис Кортунов
 
Александр Зимин
Александр ЗиминАлександр Зимин
Александр Зимин
 
Сергей Крапивенский
Сергей КрапивенскийСергей Крапивенский
Сергей Крапивенский
 
Сергей Игнатов
Сергей ИгнатовСергей Игнатов
Сергей Игнатов
 
Николай Крапивный
Николай КрапивныйНиколай Крапивный
Николай Крапивный
 
Alexander Graebe
Alexander GraebeAlexander Graebe
Alexander Graebe
 
Вадим Смирнов
Вадим СмирновВадим Смирнов
Вадим Смирнов
 
Константин Осипов
Константин ОсиповКонстантин Осипов
Константин Осипов
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
Максим Пугачев
Максим ПугачевМаксим Пугачев
Максим Пугачев
 
Rene Groeschke
Rene GroeschkeRene Groeschke
Rene Groeschke
 
Иван Бондаренко
Иван БондаренкоИван Бондаренко
Иван Бондаренко
 
Mete Atamel
Mete AtamelMete Atamel
Mete Atamel
 

Recently uploaded

办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxeditsforyah
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhimiss dipika
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Sonam Pathan
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationMarko4394
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 

Recently uploaded (17)

办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptx
 
Contact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New DelhiContact Rya Baby for Call Girls New Delhi
Contact Rya Baby for Call Girls New Delhi
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170Call Girls Near The Suryaa Hotel New Delhi 9873777170
Call Girls Near The Suryaa Hotel New Delhi 9873777170
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 

CodeFest 2014. Christopher Bennage — Semantic Logging. Avoiding the log chaos

  • 1. Christopher Bennage patterns & practices microsoft.com/practices Semantic Logging Avoiding the Log Chaos
  • 2. • No real structure • What’s in there? • Sheer number of files & types of logs is overwhelming • Hard to consume/automate • Subject to compatibility/inconsistencies. Logs are Frustrating
  • 4. Unstructured Log An example 176 [main] INFO examples.Sort - Populating an array of 2 elements in reverse order. 225 [main] INFO examples.SortAlgo - Entered the sort method. 262 [main] DEBUG SortAlgo.OUTER i=1 - Outer loop. 276 [main] DEBUG SortAlgo.SWAP i=1 j=0 - Swapping intArray[0] = 1 and intArray[1] = 0 290 [main] DEBUG SortAlgo.OUTER i=0 - Outer loop. 304 [main] INFO SortAlgo.DUMP - Dump of integer array: 317 [main] INFO SortAlgo.DUMP - Element [0] = 0 331 [main] INFO SortAlgo.DUMP - Element [1] = 1 343 [main] INFO examples.Sort - The next log statement should be an error message. 346 [main] ERROR SortAlgo.DUMP - Tried to dump an uninitialized array. 467 [main] INFO examples.Sort - Exiting main method.
  • 5. Structured Log An example using Azure Query by payload argument
  • 6. • Logging cannot be just a checkmark of doing something. • You have to think about consumption and purpose. • Allow appropriate decisions to be made at appropriate time, explicitly separating: •WHAT to log •WHEN to log it •WHERE to log We are on a mission Changing the way people think about logging
  • 7. demo >> EventSource & SLAB in-process
  • 8. Technologies at Play Event Tracing for Windows (ETW) • Native to Windows platform • Great performance & OK diagnostic tooling • Historically hard to publish events EventSource class • Introduced in .NET Framework 4.5 • Meant to ease authoring experience • Extensible but supports ETW-only out of the box Semantic Logging Application Block (SLAB) • Provides several destinations for events published with EventSource • Does not require any knowledge in ETW • Additional tooling support for authoring events
  • 10. • Sinks • Formatters • Out-Of-Process Service • Event Source Analyzer • Observable Event Listener Sinks Features of SLAB
  • 11. • Azure Tables • SQL Database • Flat file • Rolling flat file • Console • Elasticsearch Sinks Features of SLAB
  • 12. • JSON • XML • Natural (plain-text) Formatters Features of SLAB
  • 13. • Hosted as a Windows Service or console • All sinks are supported • Configuration-driven with support for re-configuration Benefits •Increased fault tolerance in case of application crash •Monitored application does not reference SLAB •Can monitor multiple processes from a single service. •Moves the logging overhead from the application to a separate process (but the overhead is still there!) Out of Process Service Features of SLAB
  • 14. // can be run in a unit test TestMethod public void EventSourceAnalyzer AExpenseEvents // will verify correctness of events // this example has inconsistent ID and order of parameters Event public void int string int this Event Source Analyzer Features of SLAB
  • 15. • Event listener is IObservable. • Event sinks are IObservers. • Can leverage Reactive Extensions (Rx) to filter, pre-process or transform the event stream before it’s persisted. Based on Observable Features of SLAB
  • 16. demo >> Flush on Error/Alarm Flood Throttle
  • 17. • Support for ActivityIds • Ability to capture events from source not publicly available • Sink for Elasticsearch • Performance improvements • Improved extensibility story • Minor bug fixes http://aka.ms/slab1_1 SLAB 1.1 What’s Coming Next Now
  • 18. • Evaluate SLAB and adopt it (search for “slab” in NuGet). • Read the docs - aka.ms/slab • Practice the Hands-on Labs & Quickstarts - aka.ms/el6hols • Engage with us by providing feedback and/or submitting contributions - slab.codeplex.com Call to Action
  • 19. • http://slab.codeplex.com • http://aka.ms/slab • http://entlib.codeplex.com Resources microsoft.com/practices • @bennage • dev.bennage.com
  • 20. Вопросы? Christopher Bennage patterns & practices Microsoft christopher.bennage@microsoft.com

Editor's Notes

  1. First, let’s acknowledge the painfulness of logging.We need logging because it helps us to understand what is going on inside of our systems. This is especially true as our system become more sophisticated. It is almost impossible to understand what is going on in a distributed or message-based system without some kind of logging.Let’s also acknowledge that logging its not a particularly interesting topic either. Often, we are only concerned about it because we know that it will be important later. Adding logging to a system can feel a like a distraction from getting the real work done. Since it is annoying to add logging, we often rush through it.The problem is compounded again by the fact that we frequently don’t knowhow we are going to use the logs until we need to use the logs.The result is that our logs are often:InconsistentWithout structureHard to consumeHard to automateOverwhelmingPhoto: http://www.flickr.com/photos/absent/2157057475/
  2. “Semantic” logging is a way to address these problems.We use the word “semantic” to express that our logs have “meaning”. You might also call this approach something like “structured” logging, or perhaps “strongly typed” logging.Even though this talk is about the Semantic Logging Application Block, what I am really interest in is changing the way you think about logging. Creating a structured or semantic log is essentially a different way of thinking about logging.The primary idea is that we deliberately include structure in the entries we log from the very beginning. We are acknowledging from the beginning that we cannot predict exactly how our logs will be consumed.The entries in our log will have more metadata describing what was logged. It also means that we use logging techniques that encourage more discipline as we set up our logging.Our intention with SLAB is to help you “put the effort in the right place”. We want to remove as much of the friction as possible for taking a more structured and semantic approach to your logs.
  3. Let’s take a look at a typical unstructured log.Here we have output from some sort of sorting algorithm. Even though I am calling it unstructured, we should recognize that it is not entirely without structure. We see things like event ids, log levels, et cetera.Nevertheless, it is not structured enough. What we really care about is usually the log message in each entry. The messages are strings that were intended to read by a human. The developer who added this logging had an understanding of what the names in the entries meant. However, it is not clear what those names mean when we look at the log after the fact.The problem is that the relevant information is flattened into the message. Unless you understand how to reserved parse the message you will have difficultly understanding what the message really means.Now this is really a simple example, imagine a more complex and distributed system. The loss context when reading the log messages becomes even more pronounced.
  4. Now let’s take a look at the output from a structured log. Here we have some log entries stored in an Azure table.We still have a message that is intended for humans to read. However, we are also retained that same information in a more structured format. Notice the “5” in the log message. Now notice how value appears in the payload for the log entry.Likewise, in the name example you can see the approver name embedded in the human-readable message, but also broken out into a separate field.This allows us to query by the payload argument without any additional parsing of the human-readable message.
  5. Our team, patterns and practices, experienced a lot of this pain first hand when we were building WASABI, the Auto Scaling Block for Azure. (I must confess that I was not part of that particular team.) We had a personal need to improve our logging.Now, we want to share the things that helped us. Specifically, we want to change the way developers think about logging.We want you to think about the consumption and purpose of the logging at the begging.We allow the appropriate decisions to be made at the appropriate times by explicitly separating:What to logWhen to log itWhere the log is storedMany logging frameworks already abstract away the idea of where the log is stored, so that’s not necessarily something new.
  6. One thing that can be confusing about SLAB is understanding the technologies that are being used and how they related to one another.Event Tracing for Windows, or ETW, is a service provided by the Windows platform. It is a general purpose, high speed tracing facility for Windows. It was first introduced all the way back in Windows 2000. It offers excellent performance, but most .NET developer are not familiar with it because it has been historically hard to use from managed code.In .NET 4.5, the EventSource class was introduced. It eases the authoring experience for tracing events. It is extensible however it only supports ETW out of the box.SLAB builds on top of EventSource, and allows you to provide different destinations for events that are published with EventSource. This means that you can use SLAB without any knowledge of ETW.
  7. Let’s take a more visual look at the technologies involved.First, you will begin by deriving from .NET’s EventSource class. This custom class is where you will define what can be logged for your system. (Remember that we are trying to separate the what, when, and where. The when is defined as the location in our application where we invoke the custom event source.)I haven’t mentioned it yet, but with SLAB you have a the choice about processes the events either in-process or out-of-process. In the in-process case, we don’t really care about ETW at all. We set up some called an ObservableEventListener that takes events published from our custom event source and writes them to the sinks. In this case, the parts that are SLAB are the ObservableEventListener itself and the sinks. This may be a little bit confusing, because ObservableEventListener inherits from EventListener which is part of .NET itself.In the out-of-process story, the custom event source in our primary application is publishing the events to ETW. From ETW, we can access the events in a few different ways such as the Event Log or PerfView.Generally though we have a secondary application running whose purpose is to receive the published events and write them to one or more sinks.
  8. Let’s talk more specifically about the features that SLAB offers. There are five high level features to understand:Sinks – are the destination where log entries will ultimately be persisted.Formatters – provide a pluggable way to format the log entries before they are persistedOut-of-process service – we provide a ready-to-go service for working with the events out-of-processEvent Source Analyzer – for ensuring that we have consistently and properly designed our event sourceObservable Event Listener – allows for interesting filtering of event using Reactive Extensions (Rx)
  9. In the box, we provide sinks for:Azure TablesSQL DatabaseFlat fileRolling flat fileConsoleElasticsearchThe sink for Elasticsearch has just been release (March 28) as part of SLAB 1.1. We’re very excited about it because it is first release since going open source, and we had significant community involvement.I should note that Windows Event Log is not supported by SLAB. However is now natively supported by EventSource.
  10. The formatters are used for sinks such as flat file and console.
  11. In the box we provide both a Windows Service and a console application that can be used to monitor events out-of-process. In both case, all of the sinks are supported. The hosts are configuration driven and there is support for re-configuring on-the-fly.The events in the originating process are sent toETW. The host is a dedicated process, independent of your application, that is used to just to persist the events to different destinations.This has several benefits, however the primary benefit is resiliency. There is increased fault tolerance in case of your application crashing. In addition, there is no need to reference SLAB in the monitored application if you are only using out-of-process. Likewise, it remove some of the logging overhead from your primary application.The output from multiple monitored applications can be sent to a single out-of-process host. There are some downsides to this. It can be slightly more complicated to set up and it is more difficult to work with at development time. We discuss the trades off in the documentation.
  12. There are still some rough edges when using EventSource. For example, you have to specify the event id in both the attribute decorating the logging method as well as in the call to WriteEvent. Likewise, you have to be consistent in the order of the parameters passed to these two methods. Since this can be error prone, SLAB provides the Event Source Analyzer. It allows you to inspect a specific instance of an event source for problems.Here you can see some sample code where we inspect the event source during a unit test.
  13. SLAB’s implementation of Event Listener implements IObservable. Likewise, the included syncs implement IObserver. These interfaces are part of Reactive Extensions, also known as Rx. Since these interfaces are used, this means that we can leverage Rx for filtering and transforming the event stream before we pass it along to a sink.I suspect that there are many of you who are not familiar with Rx. That’s okay. I should also state that there is no hard dependency on Rx unless you want to use it for processing the events. Let me do a quick demonstration of Rx and how it can work with SLAB for these who may not be familiar with it.
  14. Originally, I was going to share “what’s next” with SLAB. However, we just released the 1.1 update for SLAB (March 27).This new release includes support for ActivityIds. Activity Ids are a feature added to Event Source in .NET 4.5.1. They allow you to trace events across a logical transition. This is especially usefully when using something like TPL (Task Parallel Library). I won’t go into details here, there’s more information about Activity Id support in the release notes.In additional to some performance improvements and bug fixes, we have also included an additional sink for Elasticsearch. If you are not familiar with Elasticsearch, it’s a data store with built-in full text search and analysis capabilities. Again, more details are available in the release notes.I would also like to emphasis that this release was largely due to community contributions. All of the projects under the Enterprise Library umbrella are now open sourced under Apache 2.0 and we are welcoming community contributions. If you are interested in contributing, please check http://aka.ms/entlibopen.
  15. If you are interested in SLAB, let me recommend the following:Evaluate SLAB and adopt it (search for “slab” in NuGet).Read the docs - aka.ms/slab Practice the Hands-on Labs &Quickstarts - aka.ms/el6holsEngage with us by providing feedback and/or submitting contributions - slab.codeplex.com We are very interested in your feedback. Now that we are truly open source, you can be very direct with your feedback.  You can send us a pull request!