Sha256: d52b06d243b4b4fafefab9912c47fcc0cfdf1b02658bb098fd382ede6c63c2af

Contents?: true

Size: 557 Bytes

Versions: 3

Compression:

Stored size: 557 Bytes

Contents

Rails::Rack::Logger

# Replace rack started message with a semantic equivalent
module Rails
  module Rack
    class Logger
      @@logger = SemanticLogger['Rack']

      def self.logger
        @@logger
      end

      def started_request_message(request)
        {
          message: 'Started',
          payload: {
            method: request.request_method,
            path:   request.filtered_path,
            ip:     request.ip
          }
        }
      end

      private

      def logger
        self.class.logger
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_semantic_logger-4.0.1 lib/rails_semantic_logger/extensions/rails/rack/logger.rb
rails_semantic_logger-4.0.0 lib/rails_semantic_logger/extensions/rails/rack/logger.rb
rails_semantic_logger-4.0.0.rc1 lib/rails_semantic_logger/extensions/rails/rack/logger.rb