scout_apm_logging 0.0.8 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/scout_apm/logging/loggers/formatter.rb +7 -2
- 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: 6d85bd807f130a6b0187f898a42d6d703a2c21d21a2aac03a7dcc4d1141e1b8e
|
4
|
+
data.tar.gz: 936a7d718eb3f2d8b05d6694ab15b56dae548996d9dd24c7b4aca5a1eccadbbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c6765bc549891c2156e0d8d31b6d74862541a07685b9d81408ab14d65d5c42b83565c441a8c1520027f73db60bbb65b82778195ef358ec9a95a7b8c7bae60be
|
7
|
+
data.tar.gz: eb22f6ab71fcd15e13f3725b999ae7597161ae5f716b00f0649a8d74535747df3426b09f7a0244521ac9e16c627a0120373a73791bef1cbbfa00914e59d63df5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.0.10
|
2
|
+
* Remove capitalization from action name in the formatter, to match that of the standard format.
|
3
|
+
|
4
|
+
## 0.0.9
|
5
|
+
* Add Scout Transaction ID to log attributes.
|
6
|
+
|
1
7
|
## 0.0.8
|
2
8
|
* Fix internal method names for proxy logger to prevent accidental overriding.
|
3
9
|
* Re-broadcast to console in development for the proxy logger.
|
@@ -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.
|
@@ -50,7 +51,7 @@ module ScoutApm
|
|
50
51
|
updated_name = name.split('_').map(&:capitalize).join
|
51
52
|
|
52
53
|
derived_key = "#{layer.type.downcase}_entrypoint".to_sym
|
53
|
-
derived_value_of_scout_name = "#{updated_name}#{layer.type.capitalize}##{action
|
54
|
+
derived_value_of_scout_name = "#{updated_name}#{layer.type.capitalize}##{action}"
|
54
55
|
|
55
56
|
{ derived_key => derived_value_of_scout_name }
|
56
57
|
end
|
@@ -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.10
|
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
|