Sha256: 511b89a329e430ea343fb0752fbb75e03d40f34af5754402c6a7d54345c90b5e

Contents?: true

Size: 605 Bytes

Versions: 7

Compression:

Stored size: 605 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

7 entries across 7 versions & 1 rubygems

Version Path
roqua-support-0.4.0 lib/roqua/logging/roqua_logging_railtie.rb
roqua-support-0.3.5 lib/roqua/logging/roqua_logging_railtie.rb
roqua-support-0.3.4 lib/roqua/logging/roqua_logging_railtie.rb
roqua-support-0.3.3 lib/roqua/logging/roqua_logging_railtie.rb
roqua-support-0.3.2 lib/roqua/logging/roqua_logging_railtie.rb
roqua-support-0.3.1 lib/roqua/logging/roqua_logging_railtie.rb
roqua-support-0.3.0 lib/roqua/logging/roqua_logging_railtie.rb