logjam_agent 0.13.3 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb7dd078b4e735ccb32401f999b8c298b1cb6b4d
4
- data.tar.gz: 632a1219c3214cdb0ff26a6891e0252eec598879
3
+ metadata.gz: 5957018a83ecf2126ec5b5b9ac939268ca0d3b57
4
+ data.tar.gz: 67dfeb8457026181730c98ed1013762e57ea483c
5
5
  SHA512:
6
- metadata.gz: 422bed88a1ac4314ed28054d9ac2eccdcbfeac08939db5ecd45f4d31f5ca8b199f7e6471d6e83cc42dd802ee2f6355e507babba268904906d0428673775560b9
7
- data.tar.gz: 332cead3c74ab1f555cc36bf2e4dc95d2882e8eae94c6899db2ba3bd359fab09af7996e576e00ae0d7eb54e28aa8f05250d5094d4032e29dad1af206e222fc3b
6
+ metadata.gz: 2e4ea8eab816b52fbc114f025ed486f31615c225825a12e01e53a7b57c36c7937d8505ba96b3f65b7ee9f8106930d46dfc6c8bee06beed32bdb2078623ff28b0
7
+ data.tar.gz: 91aa0893b909026b8136d46f634f46a83df2502073bb09f9a650e281aaecb1fa385afc84f13bcd904754a33dcf3efcec0193a621e2a8dec40eb035ed604ca965
data/README.md CHANGED
@@ -56,6 +56,10 @@ module LogjamAgent
56
56
  # They will still be sent to the logjam server. Defaults to nil.
57
57
  self.log_device_ignored_lines = /^\s*Rendered/
58
58
 
59
+ # It is also possible to ovveride this on a per request basis,
60
+ # for example in a Rails before_action
61
+ # LogjamAgent.request.log_device_ignored_lines = /^\s*(?:Rendered|REDIS)/
62
+
59
63
  # Configure maximum log line length. Defaults to 2048.
60
64
  # This setting only applies to the lines sent with the request.
61
65
  self.max_line_length = 2048
@@ -124,7 +124,11 @@ module LogjamAgent
124
124
  self.max_bytes_all_lines = 1024 * 1024
125
125
 
126
126
  def self.log_to_log_device?(msg)
127
- !(log_device_ignored_lines && msg =~ log_device_ignored_lines)
127
+ if override_global_ignore_lines?
128
+ msg !~ request.log_device_ignored_lines
129
+ else
130
+ !(log_device_ignored_lines && msg =~ log_device_ignored_lines)
131
+ end
128
132
  rescue
129
133
  true
130
134
  end
@@ -210,4 +214,9 @@ module LogjamAgent
210
214
  def self.forwarder
211
215
  @forwarder ||= Forwarders.get(application_name, environment_name)
212
216
  end
217
+
218
+ def self.override_global_ignore_lines?
219
+ request && request.log_device_ignored_lines
220
+ end
221
+
213
222
  end
@@ -7,6 +7,7 @@ end
7
7
  module LogjamAgent
8
8
  class Request
9
9
  attr_reader :fields, :uuid, :start_time
10
+ attr_accessor :log_device_ignored_lines
10
11
 
11
12
  def initialize(app, env, initial_fields)
12
13
  @app = app
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.13.3"
2
+ VERSION = "0.14.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-27 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake