• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Logging

on

  • 798 views

 

Statistics

Views

Total Views
798
Views on SlideShare
739
Embed Views
59

Actions

Likes
1
Downloads
19
Comments
0

2 Embeds 59

http://jhollingworth.com 58
http://web.archive.org 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Logging Logging Presentation Transcript

    • Logging and why it’s the shit.
    • You are going to love logging!
    • Ever had to debug a live issue and had no information to go on?
    • The aim of logging is to tell the story of what the application is doing
    • You tell the story to ILog
    • private static readonly ILog _log = LogManager.GetLogger(typeof(Foo));
    • There are 4 different log levels
    • Info
    • High level user activity
    • _log.InfoFormat( "User {0} has just logged in", user.Id );
    • Debug
    • Details of the internal logic of a method
    • _log.DebugFormat( "User {0} needs to pay {2} bills", user.Id, user.Bills.Count );
    • Warn
    • Something suspicious has happened from which we have recovered but... if this happens a lot, we need to investigate
    • _log.WarnFormat( "User {0} tried to hack our servers", user.Id );
    • Error
    • Something went seriously wrong - this requires investigation because it means we have a bug.
    • _log.ErrorFormat( "Could not find User {0}’s bills", user.Id );
    • Where the hell are the logs a and how do we use them?
    • tail -f is your friend
    • Adding an identifier (e.g. user id) to your logs makes it easier to grep
    • Some do’s & don’ts
    • DO create a logger in every class you use
    • DON’T be afraid of doing LOTS of logging
    • Questions?
    • Thanks to Ed Devlin (Who initially came up with these guidelines) David Padbury (Who I stole these slides from) Images Good Friends by Juliana Coutinho, http://www.flickr.com/photos/ngmmemuda/4166182931/ Four Colors by by Tambako the Jaguar http://www.flickr.com/photos/tambako/2390708966/ Engineering Information by Calistobreeze http://www.flickr.com/photos/callisto/2172555529/ Swat by fengschwing http://www.flickr.com/photos/fengschwing/4931950933/ Comments and faves by bumblesweet http://www.flickr.com/photos/bumblesweet/4253655700/ Ahhhhhhh by kennymatic http://www.flickr.com/photos/kwl/4678498113/in/set-72157623544311963/ What is going on? by SAN_DRINO, http://www.flickr.com/photos/san_drino/1454922072/ The Simple Life by kennymatic http://www.flickr.com/photos/kwl/4574642827/in/set-72157623544311963/ the_dos_and_donts_with_babies_001 by DrJohnBullas http://www.flickr.com/photos/johnbullas/2247403198/ What the wut? by kennymatic http://www.flickr.com/photos/kwl/4514986410/in/set-72157623544311963/