fluent_logger_rails 0.4.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +3 -3
- data/CHANGELOG.md +28 -0
- data/Gemfile.lock +7 -9
- data/fluent_logger_rails.gemspec +2 -2
- data/lib/fluent_logger_rails/tagged_hash_formatter.rb +17 -7
- data/lib/fluent_logger_rails/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 768d6d458331d344eec86102de03dba87910ec455098ba412203d91af5e89d3b
|
4
|
+
data.tar.gz: 84e01b3b009488de4193a6b24833dbf03bd9d3e251fddcb6c50d9bab10b1f333
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c4a1ecdc5430cdc4c5870433de60ce263cc09e7cc9f8f244a0aa414985c4e0617769656a7016eaebfeb9a86a0868432dc034632ee6083e8e8a9b878ca720587
|
7
|
+
data.tar.gz: 66e4c2f2dee83a4dfb03896840748b0d4dffbaeec500fa14a43bf1e9a776b32b747dcf75810b114d8c5e3689fe479cbab93c6b85f529b088afafeb04c9538ad6
|
data/.github/workflows/ruby.yml
CHANGED
@@ -9,9 +9,9 @@ name: Ruby
|
|
9
9
|
|
10
10
|
on:
|
11
11
|
push:
|
12
|
-
branches: [
|
12
|
+
branches: [ main ]
|
13
13
|
pull_request:
|
14
|
-
branches: [
|
14
|
+
branches: [ main ]
|
15
15
|
|
16
16
|
jobs:
|
17
17
|
test:
|
@@ -21,7 +21,7 @@ jobs:
|
|
21
21
|
- name: Set up Ruby
|
22
22
|
uses: ruby/setup-ruby@v1
|
23
23
|
with:
|
24
|
-
ruby-version: 2.
|
24
|
+
ruby-version: 2.7
|
25
25
|
- name: Install dependencies
|
26
26
|
run: bundle install
|
27
27
|
- name: Run tests
|
data/CHANGELOG.md
CHANGED
@@ -13,6 +13,34 @@ Enhancements:
|
|
13
13
|
Deprecations:
|
14
14
|
* None
|
15
15
|
|
16
|
+
## v0.6.0
|
17
|
+
|
18
|
+
Bug Fixes:
|
19
|
+
|
20
|
+
* None
|
21
|
+
|
22
|
+
Enhancements:
|
23
|
+
|
24
|
+
* Rails 7 support
|
25
|
+
|
26
|
+
Deprecations:
|
27
|
+
|
28
|
+
* None
|
29
|
+
|
30
|
+
## v.0.5.0
|
31
|
+
|
32
|
+
Bug Fixes:
|
33
|
+
|
34
|
+
* None
|
35
|
+
|
36
|
+
Enhancements:
|
37
|
+
|
38
|
+
* Add option to allow message to be merged into payload (#8)
|
39
|
+
|
40
|
+
Deprecations:
|
41
|
+
|
42
|
+
* None
|
43
|
+
|
16
44
|
## v0.4.0
|
17
45
|
|
18
46
|
Bug Fixes:
|
data/Gemfile.lock
CHANGED
@@ -1,25 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent_logger_rails (0.
|
5
|
-
activesupport (>= 5.0, <
|
4
|
+
fluent_logger_rails (0.6.0)
|
5
|
+
activesupport (>= 5.0, < 8)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (
|
10
|
+
activesupport (7.0.4.3)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 1.6, < 2)
|
13
13
|
minitest (>= 5.1)
|
14
14
|
tzinfo (~> 2.0)
|
15
|
-
zeitwerk (~> 2.3)
|
16
15
|
coderay (1.1.3)
|
17
|
-
concurrent-ruby (1.
|
16
|
+
concurrent-ruby (1.2.2)
|
18
17
|
diff-lcs (1.4.4)
|
19
|
-
i18n (1.
|
18
|
+
i18n (1.12.0)
|
20
19
|
concurrent-ruby (~> 1.0)
|
21
20
|
method_source (1.0.0)
|
22
|
-
minitest (5.
|
21
|
+
minitest (5.18.0)
|
23
22
|
pry (0.13.1)
|
24
23
|
coderay (~> 1.1)
|
25
24
|
method_source (~> 1.0)
|
@@ -37,9 +36,8 @@ GEM
|
|
37
36
|
rspec-support (~> 3.9.0)
|
38
37
|
rspec-support (3.9.3)
|
39
38
|
timecop (0.9.1)
|
40
|
-
tzinfo (2.0.
|
39
|
+
tzinfo (2.0.6)
|
41
40
|
concurrent-ruby (~> 1.0)
|
42
|
-
zeitwerk (2.4.2)
|
43
41
|
|
44
42
|
PLATFORMS
|
45
43
|
ruby
|
data/fluent_logger_rails.gemspec
CHANGED
@@ -11,13 +11,13 @@ Gem::Specification.new do |spec|
|
|
11
11
|
"[Rails tagged logging](https://api.rubyonrails.org/classes/ActiveSupport/TaggedLogging.html) for JSON format "\
|
12
12
|
"that can be sent to Fluentd (or really any other logging backend)."
|
13
13
|
spec.authors = ["HackerOne Open Source", "Ben Willis"]
|
14
|
-
spec.email = ["opensource+fluent_logger_rails@hackerone.com", "ben@
|
14
|
+
spec.email = ["opensource+fluent_logger_rails@hackerone.com", "ben@hackerone.com"]
|
15
15
|
spec.homepage = "https://github.com/Hacker0x01/fluent_logger_rails"
|
16
16
|
|
17
17
|
spec.license = "MIT"
|
18
18
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
19
19
|
|
20
|
-
spec.add_dependency('activesupport', '>= 5.0', '<
|
20
|
+
spec.add_dependency('activesupport', '>= 5.0', '< 8')
|
21
21
|
|
22
22
|
spec.add_development_dependency 'rspec', '~> 3.6'
|
23
23
|
spec.add_development_dependency 'timecop'
|
@@ -6,18 +6,28 @@ module FluentLoggerRails
|
|
6
6
|
# be set in order to not conflict or be overridden.
|
7
7
|
attr_accessor :parent_key
|
8
8
|
|
9
|
-
def initialize
|
10
|
-
super
|
9
|
+
def initialize(merge_message_into_payload = false)
|
10
|
+
super()
|
11
|
+
@merge_message_into_payload = merge_message_into_payload
|
11
12
|
# Override the Logger::Formatter default to a format that does not have a trailing space
|
12
13
|
@datetime_format = "%Y-%m-%dT%H:%M:%S.%6N"
|
13
14
|
end
|
14
15
|
|
15
16
|
def call(severity, timestamp, _progname, msg)
|
16
|
-
payload =
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
payload = if msg.is_a?(Hash) && @merge_message_into_payload
|
18
|
+
msg
|
19
|
+
else
|
20
|
+
{
|
21
|
+
message: msg.is_a?(String) ? msg.strip : msg,
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
payload = payload.merge(
|
26
|
+
{
|
27
|
+
severity: format_severity(severity),
|
28
|
+
timestamp: format_datetime(timestamp),
|
29
|
+
},
|
30
|
+
).merge(compact_tags.deep_dup)
|
21
31
|
|
22
32
|
@parent_key ? { @parent_key => payload } : payload
|
23
33
|
end
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent_logger_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HackerOne Open Source
|
8
8
|
- Ben Willis
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
12
|
date: 2020-07-14 00:00:00.000000000 Z
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
version: '5.0'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: '
|
23
|
+
version: '8'
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
version: '5.0'
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '8'
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rspec
|
36
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,7 +79,7 @@ description: This is a library that wraps the [fluent-logger gem](https://github
|
|
79
79
|
for JSON format that can be sent to Fluentd (or really any other logging backend).
|
80
80
|
email:
|
81
81
|
- opensource+fluent_logger_rails@hackerone.com
|
82
|
-
- ben@
|
82
|
+
- ben@hackerone.com
|
83
83
|
executables: []
|
84
84
|
extensions: []
|
85
85
|
extra_rdoc_files: []
|
@@ -105,7 +105,7 @@ metadata:
|
|
105
105
|
homepage_uri: https://github.com/Hacker0x01/fluent_logger_rails
|
106
106
|
source_code_uri: https://github.com/Hacker0x01/fluent_logger_rails
|
107
107
|
changelog_uri: https://github.com/Hacker0x01/fluent_logger_rails/blob/master/CHANGELOG.md
|
108
|
-
post_install_message:
|
108
|
+
post_install_message:
|
109
109
|
rdoc_options: []
|
110
110
|
require_paths:
|
111
111
|
- lib
|
@@ -120,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
124
|
-
signing_key:
|
123
|
+
rubygems_version: 3.1.6
|
124
|
+
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: A wrapper for fluent-logger gem with support for tagged logging
|
127
127
|
test_files: []
|