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 +4 -4
- data/README.md +6 -0
- data/lib/logjam_agent.rb +3 -0
- data/lib/logjam_agent/buffered_logger.rb +1 -1
- data/lib/logjam_agent/request.rb +6 -2
- data/lib/logjam_agent/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: 500966d4c84f3bc9122958f7d36fad6e64d67d07
|
4
|
+
data.tar.gz: 16d2ff03e145e73a175f6c3174088e2c1aba37b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/logjam_agent.rb
CHANGED
@@ -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
|
data/lib/logjam_agent/request.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/logjam_agent/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|