Rack::SimpleLogger
Simple logger for rack.
Installation
Add this line to your application's Gemfile:
gem 'rack-simple_logger'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack-simple_logger
Usage
Include as Rack middleware to config.ru.
for local file:
require "rack_application"
require "rack/simple_logger"
use Rack::SimpleLogger, log: File.("../log/production.log", __FILE__)
run RackApplication.new
for MongoDB:
require "rack_application"
require "mongo"
require "rack/simple_logger"
client = Mongo::Connection.new("localhost", 27017)
database = client["logs"]
collection = database["racklog"]
use Rack::SimpleLogger, log: collection
run RackApplication.new
Contributing
- Fork it
- 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 new Pull Request