readme.md

HTTP Log

Logs all requests made to your application in a search format to
MongoDB. This gem includes a middleware to log rack requests to MongodB.
It also adds a header to every response indicating an id that can be
used to retrieve that request. You can combine this header and the one's
added by rails to track the conversation applications are having with
your application.

Installation

This gem using Mongoid to store the models. Once you install the gem,
run the mongoid config generator to setup the connection.

Filtering

You may also filter out specific requests. Requests to /assets are
filters by default. You can filter requests using three different
methods:

Symbols (treated as file extensions)

Regex (matched aganist the full URL)

Blocks/Procs/Lambda/Things that respond_to? :call

Filters are used to exclude requests. So, if a filter returns true then
that request will not be logged.

Here are some examples.

# Using SymbolsHttpLog.filters <<:jpg# Using RegexHttpLog.filters <</private/# Using Blocks/Procs/Lambdas/Things that resond_to? :call# req is ActionDispatch::Request with some sugarHttpLog.filter do |req|
req.env # perhaps access the rack request stufftrueif my_conditions_are_met
end

Adding More Log Information

You can add has many callbacks as you'd like. They are executed inside
the middleware after the initial log is instantiated. Callbacks are ran,
then the log is persisted.