Project

ramolog

0.0
No commit activity in last 3 years
No release in over 3 years
Momolog is a simple CommonLogger replacement for Rack. This module allows you to use MongoDB to store access logs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
~> 10.0

Runtime

~> 2.1
 Project Readme

Ramolog

MongoDB backed Rack's CommonLogger replacement.

Installation

Add this line to your application's Gemfile:

gem 'ramolog'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ramolog

Usage

app.rb

require 'sinatra'

configure do
  use Ramolog::Logger, ENV['MONGOLAB_URI'], 'log'
end

Log format example

{
    "_id": {
        "$oid": "567b9cc2295d3b000300001d"
    },
    "format": 1,
    "date": "2015-12-24T07:20:34+00:00",
    "referrer": "-",
    "request": {
        "method": "GET",
        "host": "www.toyoshima-house.net",
        "url": "http://www.toyoshima-house.net/index.html",
        "protocol": "HTTP/1.1",
        "acceptLanguage": "zh-cn,zh-tw"
    },
    "response": {
        "status": 200,
        "contentLength": 105,
        "responseTime": 0.408114
    },
    "remote": {
        "addr": "*.*.*.*",
        "user": "-",
        "userAgent": "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"
    }
}

For other languages