logjam_agent 0.24.10 → 0.25.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: d218225e6e9c4140849de4b3f3edaf51eefd67f3
4
- data.tar.gz: 89f7099ca6406472da645be193803cb9ad649733
3
+ metadata.gz: 500966d4c84f3bc9122958f7d36fad6e64d67d07
4
+ data.tar.gz: 16d2ff03e145e73a175f6c3174088e2c1aba37b1
5
5
  SHA512:
6
- metadata.gz: 1c9d1f4ae171302a63f1d8b2c0d8564de41fe603b8420ba328e05bd7682e8f1b35ad67520cd34da3b8e34766c73869c54ecbf9c83e8d35b4c656dc4c20b0bc16
7
- data.tar.gz: 3f1e487c11461255f052c9f0c25777067249cbdf04674dfe6cc30918fb32036e757d46c4c992b6e60e4ccaa01c6b6e83c5b666ce23ea9a478286d2b72fcc339d
6
+ metadata.gz: dea08c497c489c71b14e01551b8c53360a49a98984f679ad06f529f58b907ea17ffd444af807cfffe8bec90f9578c13b99964f1c84b84e6f3d7045a5cfab1cd7
7
+ data.tar.gz: b114a8fc7f57e54b022d3d209811a3c9534152733be1f73c1718e9bb3d46cefcf9eb5f012594668ff9dfd4f241cd784556d0eb3c0f065d530ad9c55b761c410e
data/README.md CHANGED
@@ -98,6 +98,12 @@ module LogjamAgent
98
98
  # higher compression rates.
99
99
  # self.compression_method = ZLIB_COMPRESSION
100
100
  # self.compression_method = SNAPPY_COMPRESSION
101
+
102
+ # Activate the split between hard and soft-exceptions. Soft exceptions are
103
+ # all exceptions below a log level of Logger::ERROR.
104
+ # Logjam itself can then display those soft exceptions differently.
105
+ # defaults to `false`
106
+ self.split_hard_and_soft_exceptions = true
101
107
  end
102
108
  ```
103
109
 
@@ -161,6 +161,9 @@ module LogjamAgent
161
161
  mattr_accessor :log_device_log_level
162
162
  self.log_device_log_level = Logger::INFO
163
163
 
164
+ mattr_accessor :split_hard_and_soft_exceptions
165
+ self.split_hard_and_soft_exceptions = false
166
+
164
167
  def self.log_to_log_device?(severity, msg)
165
168
  return false if severity < log_device_log_level
166
169
  if override_global_ignore_lines?
@@ -69,7 +69,7 @@ module LogjamAgent
69
69
  message ||= block.call || '' if block
70
70
  request = LogjamAgent.request
71
71
  if message.is_a?(Exception)
72
- request.add_exception(message.class.to_s) if request
72
+ request.add_exception(message.class.to_s, severity) if request
73
73
  message = format_exception(message)
74
74
  else
75
75
  message = message.to_s
@@ -75,9 +75,13 @@ module LogjamAgent
75
75
  end
76
76
  end
77
77
 
78
- def add_exception(exception)
78
+ def add_exception(exception, severity = Logger::ERROR)
79
79
  @mutex.synchronize do
80
- ((@fields[:exceptions] ||= []) << exception).uniq!
80
+ if LogjamAgent.split_hard_and_soft_exceptions && severity < Logger::ERROR
81
+ ((@fields[:soft_exceptions] ||= []) << exception).uniq!
82
+ else
83
+ ((@fields[:exceptions] ||= []) << exception).uniq!
84
+ end
81
85
  end
82
86
  end
83
87
 
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.24.10"
2
+ VERSION = "0.25.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.24.10
4
+ version: 0.25.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: 2017-02-23 00:00:00.000000000 Z
11
+ date: 2017-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake