Sha256: f7b9a9fd45d2d11fc8d0d6ea6f9a587b8a7a41907c7539071f945e8c96b171ab

Contents?: true

Size: 472 Bytes

Versions: 2

Compression:

Stored size: 472 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 "[ERROR][#{request.remote_ip}][#{request.method}][#{request.original_url}]"
      if exception
        current_logger.error exception.message
        exception.backtrace.each{ |line| current_logger.error line }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_admin_cms-0.0.6 app/controllers/concerns/cms/logger.rb
rails_admin_cms-0.0.5 app/controllers/concerns/cms/logger.rb