logjam_agent 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- Yzc0ZDQ5YzMxNjRhMjM3MDE2ZWVkZTIwNDMwYjA0ZDkzYzU3Mjg4OA==
5
- data.tar.gz: !binary |-
6
- ZmQwOWRiNjIwOGJjZThhYjA4MzM2ODllYTM4M2ZjMTkyYTYzMTg1OA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MjUwNWJkYTIzMDE3OGU0MDRhY2E3N2Q0Njc3MWIwNjAwNjQyMjIxYTQzMjc5
10
- MzZmN2U5ZTM1MTk2OTkyMGFmMmM0MjM5NzFlMWQ5OGRjNTc0NzU1YjkzYTc3
11
- MWNmODgzZGJlZTEwZWIyMThhZmQzMjVkMDRiNjFhM2U0MjkzMjA=
12
- data.tar.gz: !binary |-
13
- Y2RjZjZlN2M1ZDZlOGVhZjdkODMwYmU1YjM3YWVmMGRmOGYxNWY2Yjc5Njdk
14
- MWM0ZTg3ZDc0Y2UzYWY0ODJkM2VmNDJjY2ZiN2RjNzE1MTlmZjAzMWZlYWMy
15
- ZGZlMDhlMmYwMzYzMmNiODQ2YTg0YWUwNDg2YjZjYTVhOTFmZjM=
2
+ SHA1:
3
+ metadata.gz: 315cc908bfe71269f62fb573c7df36c5f27b6cc9
4
+ data.tar.gz: aeb4aa3170585b99d329f53ab70b83f8026110e4
5
+ SHA512:
6
+ metadata.gz: 07c026de9dc42f645dc6ce0e8a4beb52db135d828fc576b20eba54c89597bc0ec1dd59efbd9aeca4c9139f479b69f2b8ed267addd6185d979201d9933df3a145
7
+ data.tar.gz: 1a6927ef0d59f9f53d826cacded54e890e1c6d6166d7e1e789ffa9fbfd29ffa1c1047b4475a79b0d5db23e6ded3048e5e2d452f76b3d14b54e585293c0d70501
data/README.md CHANGED
@@ -51,6 +51,10 @@ module LogjamAgent
51
51
  # asset requests in development mode. Set this to false if you need
52
52
  # to debug asset request handling.
53
53
  # self.ignore_asset_requests = Rails.env.development?
54
+
55
+ # Configure lines which will not be logged locally.
56
+ # They will still be sent to the logjam server. Defaults to nil.
57
+ # self.log_device_ignored_lines = /^\s*Rendered/
54
58
  end
55
59
  ```
56
60
 
@@ -113,6 +113,13 @@ module LogjamAgent
113
113
  mattr_accessor :ignore_asset_requests
114
114
  self.ignore_asset_requests = false
115
115
 
116
+ mattr_accessor :log_device_ignored_lines
117
+ self.log_device_ignored_lines = nil
118
+
119
+ def self.log_to_log_device?(msg)
120
+ !(log_device_ignored_lines && msg =~ log_device_ignored_lines)
121
+ end
122
+
116
123
  def self.auto_detect_exception(exception_class)
117
124
  # ignore Exception classes created with Class.new (timeout.rb, my old friend)
118
125
  if (class_name = exception_class.to_s) =~ /^[\w:]+$/
@@ -77,16 +77,19 @@ module LogjamAgent
77
77
  request.add_exception(e)
78
78
  end
79
79
  end
80
+ log_to_log_device = level > Logger::INFO || LogjamAgent.log_to_log_device?(message)
80
81
  message = "#{tags_text}#{message}" unless tags_text.blank?
81
82
  time = Time.now
82
- formatted_message = formatter.call(severity, time, progname, message)
83
- if respond_to?(:buffer)
84
- buffer << formatted_message << "\n"
85
- auto_flush
86
- elsif @log # @log is a logger (or nil for rails 4)
87
- @log << "#{formatted_message}\n"
88
- elsif @logdev
89
- @logdev.write(formatted_message)
83
+ if log_to_log_device
84
+ formatted_message = formatter.call(severity, time, progname, message)
85
+ if respond_to?(:buffer)
86
+ buffer << formatted_message << "\n"
87
+ auto_flush
88
+ elsif @log # @log is a logger (or nil for rails 4)
89
+ @log << "#{formatted_message}\n"
90
+ elsif @logdev
91
+ @logdev.write(formatted_message)
92
+ end
90
93
  end
91
94
  request.add_line(severity, time, message) if request
92
95
  message
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-12 00:00:00.000000000 Z
11
+ date: 2014-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: rake
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
- - - ! '>='
17
+ - - ">="
17
18
  - !ruby/object:Gem::Version
18
19
  version: '0'
19
20
  type: :development
20
21
  prerelease: false
21
- name: rake
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
+ name: i18n
28
29
  requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- name: i18n
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
  - !ruby/object:Gem::Dependency
42
+ name: activesupport
42
43
  requirement: !ruby/object:Gem::Requirement
43
44
  requirements:
44
- - - ! '>='
45
+ - - ">="
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
47
48
  type: :runtime
48
49
  prerelease: false
49
- name: activesupport
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
+ name: time_bandits
56
57
  requirement: !ruby/object:Gem::Requirement
57
58
  requirements:
58
- - - ! '>='
59
+ - - ">="
59
60
  - !ruby/object:Gem::Version
60
61
  version: 0.6.0
61
62
  type: :runtime
62
63
  prerelease: false
63
- name: time_bandits
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.6.0
69
69
  description: Logjam logger and request information forwarding
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
77
  - Gemfile
78
78
  - README.md
79
79
  - Rakefile
@@ -98,17 +98,17 @@ require_paths:
98
98
  - lib
99
99
  required_ruby_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ! '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project: logjam_agent
111
- rubygems_version: 2.0.5
111
+ rubygems_version: 2.2.0
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Logjam client library to be used with logjam