Sha256: aaa95a528ab7baea3e6bc22d7c2b050c337562d7c13f098d57ec1b4a6b520308

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

# LogTribe

Write logs messages to multiple destinations.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'log_tribe'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install log_tribe

## Usage

### Basic example

```ruby
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 parameter'
log.debug 'debug message send too...'
log.close # Or not...
```
### Sinatra example

```ruby
# your_sinatra_app.rb
require 'log_tribe'
# ...
configure do
  # ...
  enable :logging
  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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
log_tribe-0.2.2 README.md
log_tribe-0.2.1 README.md
log_tribe-0.2.0 README.md