class RoquaLoggingRailtie < Rails::Railtie config.after_initialize do |app| RoquaLoggingRailtie.configure end class << self def configure Roqua.logger = ActiveSupport::Logger.new(output_stream).tap do |logger| logger.formatter = Logger::Formatter.new end require 'roqua/support/request_logger' Roqua::Support::RequestLogger.attach_to :action_controller end def output_stream if ENV['RAILS_LOG_TO_STDOUT_USING_ROQUA_LOGGER'].present? STDOUT else Rails.root.join("log/#{Rails.env}-events.log") end end end end