Hatchet

Ruby logging library that provides the ability to add class/module specific filters

View the Project on GitHub gshutler/hatchet

Navigation


Build status


Hosted on GitHub Pages — Theme by orderedlist

Extensions

These are lists of known appenders and formatters for Hatchet. If you have created an appender or formatter then create an issue on GitHub including the name of your extension, the line required for someone’s Gemfile, and a brief description of what it does. It will then be added to the list.

Appenders

Core

Hatchet comes with the LoggerAppender appender that delegates to a standard Logger.

hatchet-airbrake

https://github.com/adambird/hatchet-airbrake

gem 'hatchet-airbrake'

An appender that sends errors to Airbrake.

hatchet-hipchat

https://github.com/gshutler/hatchet-hipchat

gem 'hatchet-hipchat'

An appender that posts messages to HipChat rooms.

Formatters

Core

Hatchet comes three formatters, PlainFormatter, StandardFormatter and SimpleFormatter.

PlainFormatter

MESSAGE

The PlainFormatter outputs messages as they are provided without any additional context or sanitization. This is most useful with Rails’ logs as they are intended to be human readable, particularly when in development.

StandardFormatter (default)

%Y-%m-%d %H:%M:%S.%L [THREAD] LEVEL CONTEXT - MESSAGE

The StandardFormatter outputs messages in the TTCC of log4j. This is a format that is easy to grep and works well with log monitoring tools like Chainsaw.

SimpleFormatter

LEVEL - CONTEXT - MESSAGE

The SimpleFormatter outputs messages in a simpler format for when the time an thread of the message is provided by some other means. For example, Heroku adds the timestamp and thread to log messages of its own accord so it does not need to be duplicated.