logging for fun, and profit

Post on 15-Apr-2017

141 Views

Category:

Data & Analytics

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

The DNA of Great Technology

Logging for fun and profit

How to get the most value out of your logging

About Me

Been at Myriad since March 2009 Father of four I have expensive hobbies

Larry Shatzer

What is it?Let’s play:

Does this help?

How about now?

Chip Log

Who? Where?What?

When? Why?How?

Log Data

WhoWhat

Where

When

Why?

Apache Access Log

127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326

Who When WhereWhat What about these?

Per

spec

tive

Apache Access Log

127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326

Remote IP

Logged in user Timestamp HTTP

Method Resource Protocol Status Code Size

Development

Operational

Development

OperationalBusines

s

Development

Development

Is this code even alive?

Or is it dead?

Know when new errors or warnings show up

*Some tooling required

*

Misuse of the

application

Testing

Did this code get exercised?

Know what to test

OperationalBusines

s

Development

Operational

App

lica

tion

Per

form

ance

Security

Support

Root Cause Analysis

Capacity Planning

When things go wrongJust when you thought it was safe again

2

OperationalBusines

s

Development

Business

Pathing

Turn around time

Money Generating Events

Events that cost money

Compliance & Auditing

Improvement

Process

Process Improvement

What should a log message contain?

{Timestamp}

Logger

Log Level

Thread Id

MD

C V

alue

s

A • − N − •B − • • O − − −C − • − P • − − D − • • Q − − • E • R • − •F • • − S • • •G − − • T −H • • • U • • −I • • V • • • J • − − W • − −K − • − X − • • L • − • Y − • − M − − Z − − •

− − • • • • • • • • − − − • •

M E S S A G E

Usable Identifiers

Identify the user

Unique Identifier to chain events together

Timings for events

Stacktraces for errors

Your service 192.168.1.56

User: Bob

192.168.1.100

Return address

A NB OC PD QE RF SG TH UI VJ WK XL YM Z

A L E R T A B L E E V E N T S

Log Levels

ERROR

WARN

INFO

DEBUG

TRACE

Use log levels to sift

General Tips

Toomuchloggingcanslowthingsdown

Key=Value

Single unit of time

secondmillisecond

microsecondnanosecond

How granular should I go?

consistenc

y

Log in the best spot

When do I log,

or use the database?

Summary

Summary

1. Five W’s

Summary1. Five W’s

2. Consistency

Summary1. Five W’s

3. Right spot 2. Consistency

Summary1. Five W’s

4. Key=Value 2. Consistency 3. Right spot

Summary1. Five W’s

5. Perspective 2. Consistency 3. Right spot4. Key=Value

Summary1. Five W’s2. Consistency 3. Right spot4. Key=Value

5. PerspectiveOperationalBusines

s

Development

Questions?

So long and

for all the fish

Thanks

ThanksSummary

1. Five W’s2. Consistency 3. Right spot4. Key=Value

5. PerspectiveOperationalBusines

s

Development

Title Slide: https://flic.kr/p/iBeeVZ

Chip Log: http://elfshotgallery.blogspot.com/2013/05/chip-log.html https://en.wikipedia.org/wiki/Chip_log

Logbook: https://en.wikipedia.org/wiki/Logbook

Antarctic Logbook https://commons.wikimedia.org/wiki/File:USASE_Dec_15-16_1940_TA_Petras_flight_logbook.jpg

Sextant: https://flic.kr/p/eRrv7W https://en.wikipedia.org/wiki/Sextant

EKG: https://vimeo.com/63913242

Radar: https://vimeo.com/16725654

Testing: https://commons.wikimedia.org/wiki/File:USCG_RB-S_25400_rollover_testing.jpg https://en.wikipedia.org/wiki/Ship_model_basin https://flic.kr/p/BYvuh

Engine Order Telegraph: https://flic.kr/p/7W9z7M

Support: https://flic.kr/p/6Q54BX

Root Cause Analysis: https://flic.kr/p/dCB8ne

Capacity Planning: https://en.wikipedia.org/wiki/Rena_oil_spill

Money Generating Events: https://flic.kr/p/8LeF4X

Timestamp: https://en.wikipedia.org/wiki/Timestamp

Logger: https://flic.kr/p/ayd3J2

Log Level: https://upload.wikimedia.org/wikipedia/commons/7/72/House_Boat_Kerala_by_Joseph_Lazer.jpg

Thread ID: https://flic.kr/p/dU5tfC

Usable Identifiers https://flic.kr/p/zsG3d

Identify the User: https://flic.kr/p/fqi248

Stacktraces: https://flic.kr/p/nf4xa6

Log Levels: https://en.wikipedia.org/wiki/User:Jrcrin001/Carpenter_sisters#/media/File:17th-century-merchantman.jpg

Error:

https://en.wikipedia.org/wiki/File:USS_Howorth_torpedo_hit.JPG

Warn: https://en.wikipedia.org/wiki/Warning_shot#/media/File:HITRON_MH-65C_Fires_warning_shots.jpg

Info: https://flic.kr/p/8cNozC

Debug: https://flic.kr/p/mVEG5R

Trace: https://flic.kr/p/5ie8wV

Log Levels to Sift: https://commons.wikimedia.org/wiki/File:Fishing_net.jpg

General Tips: http://genesing.ch/gallery/questions-and-answers-signpost/

Too much logging: https://flic.kr/p/4TtiaZ

Single unit of time: https://upload.wikimedia.org/wikipedia/commons/1/14/Harrison%27s_Chronometer_H5.JPG

Consistency: https://flic.kr/p/4Pe4JH

Log or Database: https://flic.kr/p/8Je9gE

Attributions

top related