papertrail 0.8.3 → 0.8.4
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.
- data/README.md +10 -10
- data/lib/papertrail.rb +1 -1
- data/lib/papertrail/connection.rb +4 -2
- data/papertrail.gemspec +3 -3
- metadata +13 -6
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# papertrail
|
1
|
+
# papertrail command-line tail & search client for Papertrail log management service
|
2
2
|
|
3
3
|
Small standalone [binary] to retrieve, search, and tail recent app
|
4
4
|
server log and system syslog messages from [Papertrail].
|
@@ -6,19 +6,19 @@ server log and system syslog messages from [Papertrail].
|
|
6
6
|
Supports optional Boolean search queries and polling for new events
|
7
7
|
(like "tail -f"). Example:
|
8
8
|
|
9
|
-
papertrail -f "(www OR db) (nginx OR pgsql) -accepted"
|
9
|
+
$ papertrail -f "(www OR db) (nginx OR pgsql) -accepted"
|
10
10
|
|
11
11
|
Output is line-buffered so it can be fed into a pipe, like for grep.
|
12
12
|
See below for colorization setup.
|
13
13
|
|
14
|
-
The [
|
14
|
+
The [Connection] class can be used by other apps to perform one-off
|
15
15
|
API searches or follow (tail) events matching a given query. Interface
|
16
16
|
may change.
|
17
17
|
|
18
18
|
|
19
19
|
## Quick Start
|
20
20
|
|
21
|
-
$ [sudo] gem install papertrail
|
21
|
+
$ [sudo] gem install papertrail
|
22
22
|
$ echo "token: 123456789012345678901234567890ab" > ~/.papertrail.yml
|
23
23
|
$ papertrail
|
24
24
|
|
@@ -27,10 +27,10 @@ Retrieve token from Papertrail [User Profile].
|
|
27
27
|
|
28
28
|
## Installation
|
29
29
|
|
30
|
-
Install the gem (details on [RubyGems]), which includes a binary called
|
30
|
+
Install the gem (details on [RubyGems]), which includes a binary called
|
31
31
|
"papertrail":
|
32
32
|
|
33
|
-
$ [sudo] gem install papertrail
|
33
|
+
$ [sudo] gem install papertrail
|
34
34
|
|
35
35
|
|
36
36
|
## Configuration
|
@@ -41,7 +41,7 @@ examples/papertrail.yml.example):
|
|
41
41
|
|
42
42
|
token: 123456789012345678901234567890ab
|
43
43
|
|
44
|
-
Retrieve token from Papertrail [User Profile]. For compatibility with
|
44
|
+
Retrieve token from Papertrail [User Profile]. For compatibility with
|
45
45
|
older config files, `username` and `password` keys are also supported.
|
46
46
|
|
47
47
|
You may want to alias "trail" to "papertrail", like:
|
@@ -82,7 +82,7 @@ Save [colortailrc] as `~/.colortailrc` and edit it to enable:
|
|
82
82
|
|
83
83
|
### Shorthand
|
84
84
|
|
85
|
-
If you're using bash, create a function that accepts arguments, then
|
85
|
+
If you're using bash, create a function that accepts arguments, then
|
86
86
|
invoke `pt` with optional search operators:
|
87
87
|
|
88
88
|
$ function pt() { papertrail -f -d 5 $_ | colortail -g papertrail }
|
@@ -116,13 +116,13 @@ Enhancement or fix:
|
|
116
116
|
1. Fork the project:
|
117
117
|
http://github.com/papertrail/papertrail-cli
|
118
118
|
2. Make your changes with tests.
|
119
|
-
3. Commit the changes without changing the Rakefile or other files unrelated
|
119
|
+
3. Commit the changes without changing the Rakefile or other files unrelated
|
120
120
|
to your enhancement.
|
121
121
|
4. Send a pull request.
|
122
122
|
|
123
123
|
[binary]: https://github.com/papertrail/papertrail-cli/blob/master/bin/papertrail
|
124
124
|
[Papertrail]: http://papertrailapp.com/
|
125
|
-
[
|
125
|
+
[Connection]: https://github.com/papertrail/papertrail-cli/blob/master/lib/papertrail/connection.rb
|
126
126
|
[User Profile]: https://papertrailapp.com/user/edit
|
127
127
|
[RubyGems]: https://rubygems.org/gems/papertrail-cli
|
128
128
|
[colortail]: http://rubydoc.info/gems/colortail
|
data/lib/papertrail.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'openssl'
|
3
|
-
require '
|
3
|
+
require 'faraday_middleware'
|
4
|
+
require 'yajl/json_gem'
|
4
5
|
|
5
6
|
require 'papertrail/search_query'
|
6
7
|
|
@@ -25,7 +26,8 @@ module Papertrail
|
|
25
26
|
|
26
27
|
@connection = Faraday::Connection.new(:url => 'https://papertrailapp.com', :ssl => ssl_options) do |builder|
|
27
28
|
builder.adapter Faraday.default_adapter
|
28
|
-
builder.use
|
29
|
+
builder.use Faraday::Response::RaiseError
|
30
|
+
builder.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/
|
29
31
|
end.tap do |conn|
|
30
32
|
if options[:username] && options[:password]
|
31
33
|
conn.basic_auth(options[:username], options[:password])
|
data/papertrail.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'papertrail'
|
16
|
-
s.version = '0.8.
|
16
|
+
s.version = '0.8.4'
|
17
17
|
s.date = '2012-02-11'
|
18
18
|
s.rubyforge_project = 'papertrail'
|
19
19
|
|
@@ -50,8 +50,8 @@ Gem::Specification.new do |s|
|
|
50
50
|
## List your runtime dependencies here. Runtime dependencies are those
|
51
51
|
## that are needed for an end user to actually USE your code.
|
52
52
|
s.add_dependency('yajl-ruby')
|
53
|
-
s.add_dependency('faraday', [ '
|
54
|
-
s.add_dependency('
|
53
|
+
s.add_dependency('faraday', [ '>= 0.6', '< 0.9' ])
|
54
|
+
s.add_dependency('faraday_middleware', [ '~> 0.8.4' ])
|
55
55
|
|
56
56
|
## List your development dependencies here. Development dependencies are
|
57
57
|
## those that are only needed during development
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
8
|
+
- 4
|
9
|
+
version: 0.8.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Papertrail
|
@@ -34,16 +34,22 @@ dependencies:
|
|
34
34
|
prerelease: false
|
35
35
|
requirement: &id002 !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
segments:
|
40
40
|
- 0
|
41
41
|
- 6
|
42
42
|
version: "0.6"
|
43
|
+
- - <
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 9
|
48
|
+
version: "0.9"
|
43
49
|
type: :runtime
|
44
50
|
version_requirements: *id002
|
45
51
|
- !ruby/object:Gem::Dependency
|
46
|
-
name:
|
52
|
+
name: faraday_middleware
|
47
53
|
prerelease: false
|
48
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
49
55
|
requirements:
|
@@ -51,8 +57,9 @@ dependencies:
|
|
51
57
|
- !ruby/object:Gem::Version
|
52
58
|
segments:
|
53
59
|
- 0
|
54
|
-
-
|
55
|
-
|
60
|
+
- 8
|
61
|
+
- 4
|
62
|
+
version: 0.8.4
|
56
63
|
type: :runtime
|
57
64
|
version_requirements: *id003
|
58
65
|
description: Command-line client for Papertrail hosted log management service. Tails and searches app server logs and system syslog. Supports Boolean search and works with grep and pipe output (Unix).
|