timber 2.0.5 → 2.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -10
- data/lib/timber/cli/install.rb +4 -4
- 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: e2575049d24c209a60b30d3c307d948a4dd6fd96
|
4
|
+
data.tar.gz: 5f2fa7d925b449836a7b17f6ade39a69d9d2138e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6cefa704196b834836c4ec586a2aba41a27bdab0e11d9ca943a0ffca8425768c45c2ce71fd35f05f8aab935f2ad822e556d930736d7055f5a6515872b7f97de
|
7
|
+
data.tar.gz: afc046c48f805a946fd49353b3a56629bc1557df302790d88b9c15fb51fa5d16f2cf4569e63f5fa7a14d9ece7b4bedf16646c64e3005435c154809231af5da61
|
data/README.md
CHANGED
@@ -14,31 +14,36 @@
|
|
14
14
|
## Overview
|
15
15
|
|
16
16
|
Timber for Ruby is an optional upgrade you can install for Ruby apps on the
|
17
|
-
[Timber.io logging platform](https://timber.io).
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
[Timber.io logging platform](https://timber.io). Instead of completely replacing your log messages,
|
18
|
+
Timber automatically augments your logs with JSON metadata. Essentially turning them into
|
19
|
+
[rich events with context](https://timber.io/docs/ruby/events-and-context). This preserves the
|
20
|
+
readability of your logs while still dramatically improving the quality of your data.
|
21
|
+
The end result: better logging and faster problem solving.
|
22
22
|
|
23
|
-
|
23
|
+
|
24
|
+
## How it works
|
25
|
+
|
26
|
+
For example, Timber turns this familiar raw text log:
|
24
27
|
|
25
28
|
```
|
26
29
|
Sent 200 in 45.ms
|
27
30
|
```
|
28
31
|
|
29
|
-
Into
|
32
|
+
Into a rich [`http_server_response` event](https://timber.io/docs/ruby/events-and-context/http-server-response-event/).
|
30
33
|
|
31
34
|
```
|
32
35
|
Sent 200 in 45.2ms @metadata {"dt": "2017-02-02T01:33:21.154345Z", "level": "info", "context": {"user": {"id": 1, "name": "Ben Johnson"}, "http": {"method": "GET", "host": "timber.io", "path": "/path", "request_id": "abcd1234"}}, "event": {"http_server_response": {"status": 200, "time_ms": 45.2}}}
|
33
36
|
```
|
34
37
|
|
35
|
-
|
38
|
+
In the [Timber console](https://app.timber.io) simply
|
39
|
+
[click the line to view this metdata](https://timber.io/docs/app/tutorials/view-metadata/).
|
40
|
+
Moreover, this data allows you to run powerful queries like:
|
36
41
|
|
37
42
|
1. `context.request_id:abcd1234` - View all logs generated for a specific request.
|
38
43
|
2. `context.user.id:1` - View logs generated by a specific user.
|
39
|
-
3. `type:
|
44
|
+
3. `type:http_server_response` - View specific events (exceptions, sql queries, etc)
|
40
45
|
4. `http_server_response.time_ms:>=1000` - View slow responses with the ability to zoom out and view them in context (request, user, etc).
|
41
|
-
5. `level:
|
46
|
+
5. `level:info` - Levels in your logs!
|
42
47
|
|
43
48
|
For a complete overview, see the [Timber for Ruby docs](https://timber.io/docs/ruby/overview/).
|
44
49
|
|
data/lib/timber/cli/install.rb
CHANGED
@@ -114,19 +114,19 @@ module Timber
|
|
114
114
|
task_message = "Configuring Timber in #{path}"
|
115
115
|
write Messages.task_start(task_message)
|
116
116
|
|
117
|
+
init_logger_code = defined?(::ActiveSupport::TaggedLogging) ? "ActiveSupport::TaggedLogging.new(logger)" : "logger"
|
118
|
+
|
117
119
|
logger_code = \
|
118
120
|
case log_device_type
|
119
121
|
when :http
|
120
122
|
api_key_code = options[:api_key_code] || raise(ArgumentError.new("the :api_key_code option is required"))
|
121
123
|
|
122
|
-
logger_code = defined?(::ActiveSupport::TaggedLogging) ? "ActiveSupport::TaggedLogging.new(logger)" : "logger"
|
123
|
-
|
124
124
|
code = <<-CODE
|
125
125
|
# Install the Timber.io logger, send logs over HTTP
|
126
126
|
log_device = Timber::LogDevices::HTTP.new(#{api_key_code})
|
127
127
|
logger = Timber::Logger.new(log_device)
|
128
128
|
logger.level = config.log_level
|
129
|
-
config.logger = #{
|
129
|
+
config.logger = #{init_logger_code}
|
130
130
|
CODE
|
131
131
|
code.rstrip
|
132
132
|
|
@@ -135,7 +135,7 @@ CODE
|
|
135
135
|
# Install the Timber.io logger, send logs to STDOUT
|
136
136
|
logger = Timber::Logger.new(STDOUT)
|
137
137
|
logger.level = config.log_level
|
138
|
-
config.logger = #{
|
138
|
+
config.logger = #{init_logger_code}
|
139
139
|
CODE
|
140
140
|
code.rstrip
|
141
141
|
end
|
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.0.
|
4
|
+
version: 2.0.6
|
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-03-
|
11
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|