On Aug 28, 9:39 am, J. Pablo Fernández <[email protected]> wrote:
> It is possible with monkey patching by creating an initializer like this:
>
I'm not entirely sure what you're trying to do, but there's nothing
stopping you creating your own log subscriber, attaching it to the
relevant events and log whatever you want
Fred
> class Rails::Rack::Logger < ActiveSupport::LogSubscriber
> protected
>
> def before_dispatch(env)
> request = ActionDispatch::Request.new(env)
> info "\n\nStarted #{request.request_method} \"#{request.url}\" for
> #{request.ip} at #{Time.now.to_default_s}"
> end
> end
>
> Would there be any interest in having something like this, configurable, in
> Rails? (I did patches for Rails that never managed to gather enough
> popularity and were ignored, I'm not wasting my time again)
--
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.