Project

log_tribe

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Write logs messages to multiple destinations.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.13.7, ~> 1.13
~> 2.1.0
~> 0
~> 3.5
>= 0.49.0, ~> 0.49
>= 0.9.11, ~> 0.9
 Project Readme

LogTribe Gem Version Build Status Coverage Status

Write logs messages to multiple destinations.

Installation

Add this line to your application's Gemfile:

gem 'log_tribe'

And then execute:

$ bundle

Or install it yourself as:

$ gem install log_tribe

Usage

Basic example

log = LogTribe::Loggers.new([Logger.new(STDOUT), Fluent::Logger::FluentLogger.new(nil, host: 'srv', port: 10_010)],
                            { tag_name: 'app_name.app_type' })
log.info 'this log message is send to the 2 loggers passed in parameters'
log.debug 'debug message send too...'
log.close # Or not...

Sinatra example

# your_sinatra_app.rb
require 'log_tribe'
# ...
configure do
  # ...
  log_tribe = LogTribe::Loggers.new([Logger.new(STDOUT), 
                                     Fluent::Logger::FluentLogger.new(nil, host: 'srv', port: 10_010)])
  use Rack::CommonLogger, log_tribe
end
# ...

Contributing

  1. Fork it ( https://github.com/fenicks/log_tribe/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request