class RoquaLoggingRailtie

Public Class Methods

configure() click to toggle source
# File lib/roqua/logging/roqua_logging_railtie.rb, line 7
def configure
  Roqua.logger = ActiveSupport::Logger.new(output_stream).tap do |logger|
    logger.formatter = Logger::Formatter.new
    # Set the datetime_format to include timezone and use milliseconds instead of microseconds
    logger.formatter.datetime_format = '%Y-%m-%dT%H:%M:%S.%L%z '
  end

  require 'roqua/support/request_logger'
  Roqua::Support::RequestLogger.attach_to :action_controller
end
output_stream() click to toggle source
# File lib/roqua/logging/roqua_logging_railtie.rb, line 18
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