scout_apm_logging 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/scout_apm/logging/loggers/formatter.rb +6 -1
- data/lib/scout_apm/logging/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55f7d2c11024d2dba505a31f9a95face612da9befd41e70cce442655e5647711
|
4
|
+
data.tar.gz: 0d4b6f542d73fd0b435296e465f814b1593d7d52ae5dd31d7b07965c3e52e2a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35c113e4c84c336657d4a312385f7b23328518112be3f7a0a234eca56fd66422d264121dd0dbd19bf206ef309904ab9b3a4d40a4b50741185966979a8cb4c1a3
|
7
|
+
data.tar.gz: 6e196f2c3625af8ecc6d898a653be40f1e61511e9e20a4b7a30f5a9efa93c3eba6fda5f6bbcb3d43546800ae64b5b1fdd879d697a57f9e4e740e82b4ee350a3e
|
data/CHANGELOG.md
CHANGED
@@ -12,7 +12,7 @@ module ScoutApm
|
|
12
12
|
class Formatter < ::Logger::Formatter
|
13
13
|
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%LZ'
|
14
14
|
|
15
|
-
def call(severity, time, progname, msg)
|
15
|
+
def call(severity, time, progname, msg) # rubocop:disable Metrics/AbcSize
|
16
16
|
attributes_to_log = {
|
17
17
|
severity: severity,
|
18
18
|
time: format_datetime(time),
|
@@ -23,6 +23,7 @@ module ScoutApm
|
|
23
23
|
attributes_to_log[:progname] = progname if progname
|
24
24
|
attributes_to_log['service.name'] = service_name
|
25
25
|
|
26
|
+
attributes_to_log.merge!(scout_transaction_id)
|
26
27
|
attributes_to_log.merge!(scout_layer)
|
27
28
|
attributes_to_log.merge!(scout_context)
|
28
29
|
# Naive local benchmarks show this takes around 200 microseconds. As such, we only apply it to WARN and above.
|
@@ -66,6 +67,10 @@ module ScoutApm
|
|
66
67
|
user_context.transform_keys { |key| "user.#{key}" }.merge(extra_context)
|
67
68
|
end
|
68
69
|
|
70
|
+
def scout_transaction_id
|
71
|
+
{ "scout_transaction_id": ScoutApm::RequestManager.lookup.transaction_id }
|
72
|
+
end
|
73
|
+
|
69
74
|
def local_log_location
|
70
75
|
# Should give us the last local stack which called the log within just the last couple frames.
|
71
76
|
last_local_location = caller[0..15].find { |path| path.include?(Rails.root.to_s) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout_apm_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scout APM
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: scout_apm
|