Alephant::Logger::Cloudwatch
AWS CloudWatch driver for the alephant-logger gem.
Installation
Add this line to your application's Gemfile:
gem 'alephant-logger-cloudwatch'
And then execute:
$ bundle
Or install it yourself as:
$ gem install alephant-logger-cloudwatch
Usage
require "alephant/logger"
require "alephant/logger/cloudwatch"
cloudwatch_driver = Alephant::Logger::CloudWatch.new(:namespace => "my_namespace")
logger = Alephant::Logger.setup cloudwatch_driver
logger.metric(:name => "FooBar", :unit => "Count", :value => 1)
You can also prefill in certain values:
require "alephant/logger"
require "alephant/logger/cloudwatch"
cloudwatch_driver = Alephant::Logger::CloudWatch.new(
:namespace => "my_namespace",
:unit => "Count",
:value => 1,
:dimensions => { :foo => "bar" }
)
logger = Alephant::Logger.setup cloudwatch_driver
logger.metric(:name => "FooBar", :unit => "Count", :value => 1)
Contributing
- Fork it ( https://github.com/BBC-News/alephant-logger-cloudwatch/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request