Here is another one I don't quite understand. It seems like
RequestLog is used for logging http requests,
but I am not sure how it is getting set up. The second part
where :logger is seen doesn't quite make sense either.
Is the ruby use statement similar to the Perl use statement ? I saw
some site trying to explain it in Perl a bit. I guess I need to try to
locate my Programming in Ruby book tonight hopefully.
if $config['mongo']
begin
require 'request_log'
# customize the middleware with our own fields
use RequestLog::Middleware,
:logger =>
lambda { |data|
RequestLog::Db.requests.insert(data.attributes.merge({:port =>
data.env['SERVER_PORT'], :appname => "myapp"})) }
end
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.