class Vmpooler::API::RequestLogger

Attributes

app[R]

Public Class Methods

new(app, options = {}) click to toggle source
# File lib/vmpooler/api/request_logger.rb, line 8
def initialize(app, options = {})
  @app = app
  @logger = options[:logger]
end

Public Instance Methods

call(env) click to toggle source
# File lib/vmpooler/api/request_logger.rb, line 13
def call(env)
  status, headers, body = @app.call(env)
  @logger.log('s', "[ ] API: Method: #{env['REQUEST_METHOD']}, Status: #{status}, Path: #{env['PATH_INFO']}, Body: #{body}")
  [status, headers, body]
end