title: Access to Rails request inside ActiveSupport::LogSubscriber subclass
body: <p>I am trying to make a bit of a custom Rails logger which ultimately will log to a database.  However, I don't have access to things like the request object, which I very much would like to have.</p>
  
  <p>I'm currently trying to use the LogSubscriber (notification) interface to do the bulk of this; perhaps this is not the right approach.  I do know I could abuse Thread.current[] but I was hoping to avoid doing that.</p>
  
  <p>Here's the code I have which is as basic as I can get it for an example.  This is loaded in an initializer.</p>
  
  <pre><code>module RequestLogging
    class LogSubscriber &lt; ActiveSupport::LogSubscriber
      def process_action(event)
        pp request # &lt;--- does not work
        pp event
      end
  end
  
  RequestLogging::LogSubscriber.attach_to :action_controller
  </code></pre>