Sha256: b4e86f3e8fd314700c663ca2a764e6d84b44467a8837aff787afe8bb1899e962

Contents?: true

Size: 647 Bytes

Versions: 3

Compression:

Stored size: 647 Bytes

Contents

module CMS
  module Logger
    extend ActiveSupport

    protected

    def cms_logger(exception, log_name = nil)
      current_logger = log_name ? ::Logger.new("#{Rails.root}/log/#{log_name}.log") : logger
      current_logger.error ''
      current_logger.error "[EXCEPTION][#{request.remote_ip}][#{request.method}][#{request.original_url}]"
      if exception
        current_logger.error exception.message
        exception.backtrace.first(RailsAdminCMS::Config.exception_backtrace_size).each do |line|
          current_logger.error line
        end
      end
      current_logger.error '[END]'
      current_logger.error ''
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_admin_cms-0.1.1 app/controllers/concerns/cms/logger.rb
rails_admin_cms-0.0.9 app/controllers/concerns/cms/logger.rb
rails_admin_cms-0.0.7 app/controllers/concerns/cms/logger.rb