What’s logbook?
Logbook is a hosted service for collecting log entries from your application.
Requirements
Works in Rails 3 only at the moment. Check back later for more framework / versions.
Getting started
-
Go to logbook.me and create an account
-
Download logbook.yml that it genereated for you to the config dir
-
Add this gem to your Gemfile:
gem ‘logbook’
Usage
Anywhere in your application:
Logbook.debug 'facility', { :my => 'data' }
Logbook has a method for every severity supported by the standard Ruby logger (in order of priority: debug < info < warn < error < fatal < unknown). Thefirst parameter it takes specifies “facility”. It’s a linux syslog analogy and allows to have different “types” of log entries so that you could filter them in the web interface more easily later. The second parameter needs to be a hash with any data that you want to log. Passing a hash is good because it allows to log structured data, which again makes it possible to filter records in the web interface.
Authors
We created this service and gem during Rails Rumble 2010: railsrumble.com/teams/48-hours-of-unpaid-work-and-5-cookies