Sha256: 7ca086770f95d53997c9a99b74ee87a4787083d91b340ab32321bd2422fb038e

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roqua-support-0.1.34 lib/roqua/logging/roqua_logging_railtie.rb