rack-http-logger 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -3
- data/{LICENSE → LICENSE.md} +1 -1
- data/README.md +16 -9
- data/lib/rack/http-logger.rb +4 -4
- data/rack-http-logger-0.2.0.gem +0 -0
- data/rack-http-logger.gemspec +4 -3
- metadata +22 -21
- data/rack-http-logger-0.0.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd3d65614b42572ab7cdb0dac8be048f385f0fd7
|
4
|
+
data.tar.gz: 05afe553209b79960a18a80d7fb16055ad8994a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfabf193f487bed015df776e5827953c84d13126999dd0b75b893e6abf49d3c996adc191ad142c6baa91837f7dd37f1ab1c92ef5ab138b9626577dda7e651277
|
7
|
+
data.tar.gz: 0300c9bbfef8c223f3f8b404b6af2c4e4581d0e4765ef5b710ffa36b9b684e3a4bc63d04b935b42712ae7fb47e2bf3194d9503ea45f63143f53cce7757cd6940
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-http-logger (0.1
|
4
|
+
rack-http-logger (0.2.1)
|
5
5
|
rack (~> 1.5)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
rack (1.
|
11
|
-
rake (
|
10
|
+
rack (1.6.11)
|
11
|
+
rake (12.3.2)
|
12
12
|
|
13
13
|
PLATFORMS
|
14
14
|
ruby
|
@@ -16,3 +16,6 @@ PLATFORMS
|
|
16
16
|
DEPENDENCIES
|
17
17
|
rack-http-logger!
|
18
18
|
rake
|
19
|
+
|
20
|
+
BUNDLED WITH
|
21
|
+
2.0.1
|
data/{LICENSE → LICENSE.md}
RENAMED
data/README.md
CHANGED
@@ -1,8 +1,18 @@
|
|
1
1
|
# Rack::HTTPLogger
|
2
2
|
|
3
|
-
`Rack::HTTPLogger` is Rack middleware
|
4
|
-
|
5
|
-
|
3
|
+
`Rack::HTTPLogger` is Rack middleware
|
4
|
+
that provides a logging endpoint for your application.
|
5
|
+
HTTP request parameters are automatically formatted
|
6
|
+
according to [l2met](https://github.com/ryandotsmith/l2met)
|
7
|
+
and logged to a specified stream,
|
8
|
+
such as `STDOUT`.
|
9
|
+
|
10
|
+
This is designed for anyone using Heroku,
|
11
|
+
which uses [Logplex](https://devcenter.heroku.com/articles/logplex)
|
12
|
+
to aggregate messages for further monitoring and analytics.
|
13
|
+
With `Rack::HTTPLogger` remote events,
|
14
|
+
such as mobile device registrations,
|
15
|
+
can be collected and processed into your common log stream.
|
6
16
|
|
7
17
|
## Installation
|
8
18
|
|
@@ -32,12 +42,9 @@ use Rack::HTTPLogger
|
|
32
42
|
|
33
43
|
## Contact
|
34
44
|
|
35
|
-
Mattt
|
36
|
-
|
37
|
-
- http://github.com/mattt
|
38
|
-
- http://twitter.com/mattt
|
39
|
-
- m@mattt.me
|
45
|
+
[Mattt](https://twitter.com/mattt)
|
40
46
|
|
41
47
|
## License
|
42
48
|
|
43
|
-
Rack::HTTPLogger is available under the MIT license.
|
49
|
+
Rack::HTTPLogger is available under the MIT license.
|
50
|
+
See the LICENSE file for more info.
|
data/lib/rack/http-logger.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Rack #:nodoc:
|
2
2
|
class HTTPLogger
|
3
|
-
VERSION = '0.1
|
3
|
+
VERSION = '0.2.1'
|
4
4
|
|
5
5
|
def initialize(app, options = {})
|
6
6
|
@app = app
|
@@ -14,11 +14,11 @@ module Rack #:nodoc:
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def call(env)
|
17
|
-
return @app.call(env) unless env["REQUEST_METHOD"] == @method and env["REQUEST_PATH"] == @path
|
18
|
-
|
19
17
|
request = Rack::Request.new(env)
|
20
18
|
|
21
|
-
|
19
|
+
return @app.call(env) unless request.request_method == @method and request.path == @path
|
20
|
+
|
21
|
+
if request.media_type == "application/json" and (body = request.body.read).length.nonzero?
|
22
22
|
log JSON.parse(body)
|
23
23
|
else
|
24
24
|
log request.params
|
Binary file
|
data/rack-http-logger.gemspec
CHANGED
@@ -4,9 +4,10 @@ require "rack/http-logger"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "rack-http-logger"
|
7
|
-
s.authors = ["Mattt
|
8
|
-
s.email = "
|
9
|
-
s.
|
7
|
+
s.authors = ["Mattt"]
|
8
|
+
s.email = "mattt@me.com"
|
9
|
+
s.license = 'MIT'
|
10
|
+
s.homepage = "https://mat.tt"
|
10
11
|
s.version = Rack::HTTPLogger::VERSION
|
11
12
|
s.platform = Gem::Platform::RUBY
|
12
13
|
s.summary = "Rack::HTTPLogger"
|
metadata
CHANGED
@@ -1,60 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-http-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Mattt
|
7
|
+
- Mattt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Log arbitrary metrics from HTTP request parameters according to l2met
|
42
42
|
conventions.
|
43
|
-
email:
|
43
|
+
email: mattt@me.com
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- ./Gemfile
|
49
|
-
- ./Gemfile.lock
|
50
|
-
- ./
|
51
|
-
- ./
|
52
|
-
- ./
|
53
|
-
- ./rack
|
54
|
-
- ./
|
55
|
-
- ./
|
56
|
-
homepage:
|
57
|
-
licenses:
|
48
|
+
- "./Gemfile"
|
49
|
+
- "./Gemfile.lock"
|
50
|
+
- "./LICENSE.md"
|
51
|
+
- "./README.md"
|
52
|
+
- "./Rakefile"
|
53
|
+
- "./lib/rack/http-logger.rb"
|
54
|
+
- "./rack-http-logger-0.2.0.gem"
|
55
|
+
- "./rack-http-logger.gemspec"
|
56
|
+
homepage: https://mat.tt
|
57
|
+
licenses:
|
58
|
+
- MIT
|
58
59
|
metadata: {}
|
59
60
|
post_install_message:
|
60
61
|
rdoc_options: []
|
@@ -62,17 +63,17 @@ require_paths:
|
|
62
63
|
- lib
|
63
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
65
|
requirements:
|
65
|
-
- -
|
66
|
+
- - ">="
|
66
67
|
- !ruby/object:Gem::Version
|
67
68
|
version: '0'
|
68
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
70
|
requirements:
|
70
|
-
- -
|
71
|
+
- - ">="
|
71
72
|
- !ruby/object:Gem::Version
|
72
73
|
version: '0'
|
73
74
|
requirements: []
|
74
75
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.
|
76
|
+
rubygems_version: 2.6.14
|
76
77
|
signing_key:
|
77
78
|
specification_version: 4
|
78
79
|
summary: Rack::HTTPLogger
|
data/rack-http-logger-0.0.1.gem
DELETED
Binary file
|