bbc/mozart-logger

Name: mozart-logger

Owner: BBC

Description: Gem for setting up logging and metrics for Mozart services

Created: 2016-01-18 14:55:09.0

Updated: 2016-03-17 13:59:46.0

Pushed: 2016-07-25 11:29:34.0

Homepage:

Size: 10

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Mozart::Logger

Internal gem for setting up structured logging and metrics for use within our Mozart service applications.

It is an abstraction wrapping around our open-source software Alephant Logger.

Installation

Add this line to your application's Gemfile:

p :production do
m "mozart-logger", "1.0.0", :git => "git@github.com:bbc/mozart-logger.git"

And then execute:

$ bundle install
Setup
ire "mozart/logger"

 = {
tatsd => {
:host      => ENV["STATSD_HOST"],
:port      => 8125,
:namespace => "mozart-routing"

loudwatch => {
:namespace => ENV["CLOUDWATCH_NAMESPACE"]



rt::Logger.setup opts, ENV["APP_LOG_LOCATION"] # configures Alephant Logger

Rack::CommonLogger, Alephant::Logger.get_logger # optional

Note: you should only provide one key
either :statsd or :cloudwatch
the latter will be ignored if both provided

Usage
ire "alephant/logger"

s Foo
clude include Alephant::Logger

f initialize
logger.info(
  "event"   => "ClassInitialized",
  "method"  => "#{self.class.name}##{__method__}",
  "someKey" => 123
)
d

Note: for more details, refer to the following gems
Alephant-Logger-CloudWatch, Alephant-Logger-Statsd and Alephant-Logger-JSON


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.