rack-log-request 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class LogRequest
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -30,10 +30,12 @@ module Rack
30
30
 
31
31
  def call(env)
32
32
  t = Time.now
33
- re = @app.call(env)
33
+ status, headers, response = @app.call(env)
34
34
  @mongo_collection.insert({:request => env['REQUEST_URI'],
35
+ :status => status,
36
+ :size => response.body.size,
35
37
  :millis => (Time.now - t)*1000})
36
- return re
38
+ return [status, headers, response]
37
39
  end
38
40
 
39
41
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-log-request
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cyril Mougel