centralized logging

39
zed Logging

Upload: blessyahu

Post on 22-Jun-2015

260 views

Category:

Technology


1 download

DESCRIPTION

A presentation I did on what, why, how, and benefits of centralized logging in the Enterprise. This presentation was focused on implementing centralized logging in a environment that is mostly .NET/Windows.

TRANSCRIPT

Page 1: Centralized logging

Centralized Logging

Page 2: Centralized logging

Logging provides value.

How’s that now?

Page 3: Centralized logging

How does logging provide value?

We can gather information on the system while it’s in operation. We can use this information to provide more value to the business.

Page 4: Centralized logging

More Value?Information gathered from logs allows you to proactively take actions that will keep systems providing the most value to the business.

Page 5: Centralized logging

Talk in circles much?

Centralized logging provides visibility into the operational efficiency of the system and process.

Page 6: Centralized logging

A story on operational sleep efficiency

Page 7: Centralized logging

How is it done?

Logs for most/all systems are shipped, parsed and stored in a central location for monitoring and decision making.

Page 8: Centralized logging

Um…sounds like a bunch of work.

IIS LogsSQL LogsRouter LogsEtc.

Page 9: Centralized logging

Initial focus is on application logging for in-house applications.

Page 10: Centralized logging

Where we are…

Where many are…we’re not alone.

System logs file to directory

System logs file to database

?System

logs file to directory

Page 11: Centralized logging

Where we want to go.

A system that has the ability to store and analyze log data from any system that provides it.

Shipper

App

ViewerParsing, Indexing,

Storage

Logger

Systems

Page 12: Centralized logging

Logging Issuesto resolve

Page 13: Centralized logging

Access To LogGetting access to production servers is not always easy.

Page 14: Centralized logging

Standardizing Logging format

While enabling extensibility…

Log(“Error Occurred, 45, 64”)

Log({Error : “Doh!”,Exeception : ex})

Mobile Client Log

Service Log

Database Log

MVC Application LogDNN Log

Web Client(js) Log

Page 15: Centralized logging

Access to all log data

DB

Service/Logic

Data Tier

Web ClientMobile Client

Logs

Logs

Logs

Logs

Logs

Page 16: Centralized logging

Use log data for…

• Troubleshoot errors and design• Monitoring and notification• Auditing

Page 17: Centralized logging

Business decisions (Analytics)

Upcoming version of Kibana!

Page 18: Centralized logging

The Good

& Bad

of existing solutions

Page 19: Centralized logging

Windows Event Log

• Low Cost – Built in.• Built in UI• Can forward logs to a central server

Good

Page 20: Centralized logging

Windows Event Log

• Event entries stored in memory.• Have to configure logging per server.• Service interface for other clients to

hook into not available.

Bad

Page 21: Centralized logging

Log to central SQL database

• Low Cost – SQL in house, create an database/table.

Good

Page 22: Centralized logging

Log to central SQL database

• Relational (Schema based) format challenging to use for unstructured data.

• logging straight to database could degrade application performance.

Bad

Page 23: Centralized logging

Commercial Hosted Tools

• Handles multiple log formats• Robust charting/searching Features

Good

Page 24: Centralized logging

• Turned down previously• $$$ - pricey for amount of

space allotted

Bad

Commercial Hosted Tools

Page 25: Centralized logging

And the winner is….

A Hybrid Approach.

Page 26: Centralized logging

Application

Redis Queue

Log Indexer

Kibana

Application

EL

Application

Elastic Search

Log

Lo

g

Log

ELEL

Rest APIArchival

Page 27: Centralized logging

Low(No) Cost

OSS FTW!

Page 28: Centralized logging

Extensible

Using a Pub/Sub pattern from the queue will allow other components to subscribe to it.

Redis Queue

Log Indexer(Publisher)

Statistics(Subscriber)

Notifications(Subscriber)

Page 29: Centralized logging

Runs on Windows

Java/Ruby based tools run on windows with some setup.

Page 30: Centralized logging

Blocking

Asynchronous

Mes

sage

Queu

e

No

Page 31: Centralized logging

Why ElasticSearch?

You mean aside from the fact that StackOverflow founder uses it?

Page 32: Centralized logging

Inverted Index“In computer science, an inverted index (also referred to as postings file or inverted file) is anindex data structure storing a mapping from content, such as words or numbers, to its locations in adatabase file, or in a document or a set of documents. The purpose of an inverted index is to allow fast  full text searches, at a cost of

increased processing when a document is added to the database.” via http://en.wikipedia.org/wiki/Inverted_index

Page

WordWordWord

Word

PagePagePage

Regular Index Inverted Index

Page 33: Centralized logging

Documented Oriented• No need to define schema upfront• Can store, index and quickly search unstructured data.• Schema can be defined per type for customization of

the indexing process.

Page 34: Centralized logging

Big Community

• VIA http://www.elasticsearch.org/community/

Page 35: Centralized logging

Easy to scale

• Distributed by nature.• Indexes broken down by shards with 0 or more

replicas.

Page 36: Centralized logging

Easy Level 1 Rest API

• Well documented and straight forward api, which makes it easy to build a client for it.

Page 37: Centralized logging

What’s Needed recap• Server for Elastic Search (Windows/Linux)• Redis Server• Windows service to index logs from queue.• Modify Enterprise Library Logger to send to

queue.

Page 38: Centralized logging

In closingGathering the data is one part. Logging enough information and knowing what questions your are looking to answer is another part.

Page 39: Centralized logging

References