timber 2.1.0.rc1 → 2.1.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +25 -23
- data/lib/timber/integrations/rack/http_events.rb +5 -1
- data/lib/timber/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afb17c6cddef2161cdea1673f0ff79a60e0738d9
|
4
|
+
data.tar.gz: 2ff32da4c3329a55a0c7c8a76c56c165fd2d7459
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9c7f09df8f61f7c3d97c589a098e5db6bc4d785ca52e01b70d21d382a3c662b7802b7fc05a63b8e83f495b8e0fdef0a878b439a42e3b2edce161e1320d21610
|
7
|
+
data.tar.gz: 565dc4e47de83e6f430828a2d953a9071f1398ce062cfe4ff3375b064ca721bdcd5dea47c70e4492c28c2449ac36591e77e0fe50f63c7efec82193a8def471e3
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# 🌲 Timber -
|
1
|
+
# 🌲 Timber - Simple Ruby Structured Logging
|
2
2
|
|
3
3
|
[![ISC License](https://img.shields.io/badge/license-ISC-ff69b4.svg)](LICENSE.md)
|
4
4
|
[![Build Status](https://travis-ci.org/timberio/timber-ruby.svg?branch=master)](https://travis-ci.org/timberio/timber-ruby)
|
@@ -24,10 +24,10 @@ focusing on logging.
|
|
24
24
|
in a consistent format. See [how it works](#how-it-works) below.
|
25
25
|
|
26
26
|
3. **Seamlessly integrates with popular libraries and frameworks.** - Rails, Rack, Devise,
|
27
|
-
Omniauth, etc. [Automatically captures user context, HTTP context, and event data.](#third-party-
|
27
|
+
Omniauth, etc. [Automatically captures user context, HTTP context, and event data.](#third-party-integrations)
|
28
28
|
|
29
|
-
4. **Pairs with a modern console.** - Designed specifically for this librariy, instantly
|
30
|
-
usable, zero configuration.
|
29
|
+
4. **Pairs with a modern console.** - Designed specifically for this librariy, hosted, instantly
|
30
|
+
usable, zero configuration. [Checkout the docs](https://timber.io/docs/app/overview/).
|
31
31
|
|
32
32
|
|
33
33
|
## Installation
|
@@ -45,7 +45,7 @@ focusing on logging.
|
|
45
45
|
|
46
46
|
## How it works
|
47
47
|
|
48
|
-
Let's start with an example. Timber turns this
|
48
|
+
Let's start with an example. Timber turns this:
|
49
49
|
|
50
50
|
```
|
51
51
|
Sent 200 in 45.2ms
|
@@ -54,13 +54,13 @@ Sent 200 in 45.2ms
|
|
54
54
|
Into a rich [`http_server_response` event](https://timber.io/docs/ruby/events-and-context/http-server-response-event/).
|
55
55
|
|
56
56
|
```
|
57
|
-
Sent 200 in 45.2ms @metadata {"dt": "2017-02-02T01:33:21.154345Z", "level": "info", "context": {"
|
57
|
+
Sent 200 in 45.2ms @metadata {"dt": "2017-02-02T01:33:21.154345Z", "level": "info", "context": {"http": {"method": "GET", "path": "/path", "remote_addr": "192.32.23.12", "request_id": "abcd1234"}, "system": {"hostname": "1.server.com", "pid": "254354"}, "user": {"id": 1, "name": "Ben Johnson", "email": "bens@email.com"}}, "event": {"http_server_response": {"status": 200, "time_ms": 45.2}}}
|
58
58
|
```
|
59
59
|
|
60
60
|
Notice that instead of completely replacing your log messages,
|
61
|
-
Timber _augments_ your logs with structured metadata. Turning them into
|
61
|
+
Timber _augments_ your logs with structured metadata. Turning turns them into
|
62
62
|
[rich events with context](https://timber.io/docs/ruby/events-and-context) without sacrificing
|
63
|
-
readability.
|
63
|
+
readability. And you have [complete control over which data is captured](#configuration).
|
64
64
|
|
65
65
|
This is all accomplished by using the
|
66
66
|
[Timber::Logger](http://www.rubydoc.info/github/timberio/timber-ruby/Timber/Logger):
|
@@ -77,20 +77,21 @@ Here's a better look at the metadata:
|
|
77
77
|
"dt": "2017-02-02T01:33:21.154345Z",
|
78
78
|
"level": "info",
|
79
79
|
"context": {
|
80
|
-
"user": {
|
81
|
-
"id": 1,
|
82
|
-
"name": "Ben Johnson"
|
83
|
-
},
|
84
80
|
"http": {
|
85
81
|
"method": "GET",
|
86
|
-
"host": "timber.io",
|
87
82
|
"path": "/path",
|
83
|
+
"remote_addr": "192.32.23.12",
|
88
84
|
"request_id": "abcd1234"
|
89
85
|
},
|
90
86
|
"system": {
|
91
87
|
"hostname": "1.server.com",
|
92
88
|
"pid": "254354"
|
93
|
-
}
|
89
|
+
},
|
90
|
+
"user": {
|
91
|
+
"id": 1,
|
92
|
+
"name": "Ben Johnson",
|
93
|
+
"email": "bens@email.com"
|
94
|
+
},
|
94
95
|
},
|
95
96
|
"event": {
|
96
97
|
"http_server_response": {
|
@@ -118,7 +119,7 @@ So what can you do with this data?
|
|
118
119
|
For a complete overview, see the [Timber for Ruby docs](https://timber.io/docs/ruby/overview/).
|
119
120
|
|
120
121
|
|
121
|
-
## Third-party
|
122
|
+
## Third-party integrations
|
122
123
|
|
123
124
|
1. **Rails**: Structures ([HTTP requests](https://timber.io/docs/ruby/events-and-context/http-server-request-event/), [HTTP respones](https://timber.io/docs/ruby/events-and-context/http-server-response-event/), [controller calls](https://timber.io/docs/ruby/events-and-context/controller-call-event/), [template renders](https://timber.io/docs/ruby/events-and-context/template-render-event/), and [sql queries](https://timber.io/docs/ruby/events-and-context/sql-query-event/)).
|
124
125
|
2. **Rack**: Structures [exceptions](https://timber.io/docs/ruby/events-and-context/exception-event/), captures [HTTP context](https://timber.io/docs/ruby/events-and-context/http-context/), captures [user context](https://timber.io/docs/ruby/events-and-context/user-context/), captures [session context](https://timber.io/docs/ruby/events-and-context/session-context/).
|
@@ -379,14 +380,15 @@ end
|
|
379
380
|
<details><summary><strong>Capture release / deploy context</strong></summary><p>
|
380
381
|
|
381
382
|
[Timber::Contexts::Release](http://www.rubydoc.info/github/timberio/timber-ruby/Timber/Contexts/Release)
|
382
|
-
tracks the current application release and version. If you
|
383
|
-
[dyno metadata](https://devcenter.heroku.com/articles/dyno-metadata) feature
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
383
|
+
tracks the current application release and version. If you're on Heroku, simply enable the
|
384
|
+
[dyno metadata](https://devcenter.heroku.com/articles/dyno-metadata) feature. If you are not,
|
385
|
+
set the following environment variables and this context will be added automatically:
|
386
|
+
|
387
|
+
1. `RELEASE_COMMIT` - Ex: `2c3a0b24069af49b3de35b8e8c26765c1dba9ff0`
|
388
|
+
2. `RELEASE_CREATED_AT` - Ex: `2015-04-02T18:00:42Z`
|
389
|
+
3. `RELEASE_VERSION` - Ex: `v2.3.1`
|
390
|
+
|
391
|
+
All variables are optional, but at least one must be present.
|
390
392
|
|
391
393
|
---
|
392
394
|
|
@@ -105,7 +105,11 @@ module Timber
|
|
105
105
|
request = Util::Request.new(env)
|
106
106
|
|
107
107
|
if silenced?(env, request)
|
108
|
-
Config.instance.logger.silence
|
108
|
+
if Config.instance.logger.respond_to?(:silence)
|
109
|
+
Config.instance.logger.silence do
|
110
|
+
@app.call(env)
|
111
|
+
end
|
112
|
+
else
|
109
113
|
@app.call(env)
|
110
114
|
end
|
111
115
|
|
data/lib/timber/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.
|
4
|
+
version: 2.1.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timber Technologies, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|