Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fluent input plugin for Rails3 production.log

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
README.md

fluent-plugin-Rails3_log

Fluent input plugin for Rails3 production.log

How to use

Puts in_Rails3_log.rb to plugin directory.

% cp in_Rails3_log.rb path/to/fluent/plugin

Edit setting file.

% edit fluent.conf
<source>
  type Rails3_log
  path path/to/log/production.log
  tag rails3.log
</source>

Expected record format

Sample

Started GET "/questions/7" for 127.0.0.1 at 2012-05-18 00:45:40 +0800
Processing by QuestionsController#show as JSON
  Parameters: {"id"=>"7"}
  ...
  ...
  Rendered questions/show.json.jbuilder (20.3ms)
Completed 200 OK in 25ms (Views: 16.9ms | ActiveRecord: 2.7ms | Sphinx: 0.0ms)

Then following JSON is going to be made.

{
         "method" => "GET",
           "path" => "/questions/7",
     "ip_address" => "127.0.0.1",
    "access_time" => "2012-05-18 00:43:28 +0800",
     "controller" => "QuestionsController",
         "action" => "show",
           "mime" => "JSON",
    "status_code" => "200",
     "status_msg" => "OK",
      "proc_time" => "25",
     "views_time" => "16.9",
        "ar_time" => "2.7",
    "sphinx_time" => "0.0"
}
Something went wrong with that request. Please try again.