Class: RoquaLoggingRailtie
- Inherits:
-
Rails::Railtie
- Object
- Rails::Railtie
- RoquaLoggingRailtie
- Defined in:
- lib/roqua/logging/roqua_logging_railtie.rb
Class Method Summary collapse
Class Method Details
.configure ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# 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 ⇒ Object
18 19 20 21 22 23 24 |
# 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 |