act-fluent-logger-rails 0.6.2 → 0.6.3

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
  SHA256:
3
- metadata.gz: c4a5f8557252e81bf439315720d56e55a7142ef99e94192b8b20ad7c6f70a232
4
- data.tar.gz: 83d54f7cf71f2438efe0f0f91bb307fdc2230622f039f2b5a2a49e416faa04ff
3
+ metadata.gz: f263d124e7851ae0d53b5c1d5c7fb4804cd948151464e98e2373300467495f2b
4
+ data.tar.gz: e99b7d0c656a6bb4eeb1cae6d8909ebde1564f0e90a3c115d03c7e282db6adc3
5
5
  SHA512:
6
- metadata.gz: 817726d7cc7a8656f3768da96eece0d87f68974e01a35b67e207a27cf28229f25281766163b6cd8ed4fddc59dba305da6c6b2fc50787dcad4dd4736ad3179db3
7
- data.tar.gz: 141ee6675d47c310c61828e907640390bf0080dd001ea5c9258bded272287988270e17f155a7c9cd640e7d033afa885d9c8e93ebba517f4ec07494363d61d03d
6
+ metadata.gz: 02d7b6e3bc21c6b04664bf1a8dc3378ac45e9867dfd5406219a050f7b14251c81282ca3b549a9fedcf88fee15498f14af089583eb5dc9edf07a02c786b03c296
7
+ data.tar.gz: 6a86c3ecb7be63f7e318d257f484f2e5afc1c3694ec5b8fab87a0b72a289ab496ac3fad0724387fdb44be6b0c680576deb834b0e651d04a12aa4c04e10d6265c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.6.3 / Mar 22 2020
2
+ * Support tls_options #63
3
+
1
4
  ## 0.6.2 / Jan 8 2020
2
5
  * Rails 6.1
3
6
 
data/README.md CHANGED
@@ -89,6 +89,9 @@ Don't use config.log_tags.
89
89
  2013-01-18T15:04:50+09:00 foo {"messages":["Started GET \"/\" for 127.0.0.1 at 2013-01-18 15:04:49 +0900","Processing by TopController#index as HTML","Completed 200 OK in 635ms (Views: 479.3ms | ActiveRecord: 39.6ms)"],"severity":"INFO"}
90
90
  ```
91
91
  * severity_key: The key of severity(DEBUG, INFO, WARN, ERROR).
92
+ * tls_options: A hash of tls options compatible with [fluent-logger-ruby](https://github.com/fluent/fluent-logger-ruby#tls-setting). The simplest being:
93
+ <pre>tls_options:
94
+ use_default_ca: true</pre>
92
95
 
93
96
  You can add any tags at run time.
94
97
 
@@ -41,6 +41,7 @@ module ActFluentLoggerRails
41
41
  nanosecond_precision: fluent_config['nanosecond_precision'],
42
42
  messages_type: fluent_config['messages_type'],
43
43
  severity_key: fluent_config['severity_key'],
44
+ tls_options: fluent_config['tls_options']&.transform_keys { |k| k.to_sym }
44
45
  }
45
46
  end
46
47
 
@@ -86,6 +87,7 @@ module ActFluentLoggerRails
86
87
  @severity_key = (options[:severity_key] || :severity).to_sym
87
88
  @flush_immediately = options[:flush_immediately]
88
89
  logger_opts = {host: host, port: port, nanosecond_precision: nanosecond_precision}
90
+ logger_opts[:tls_options] = options[:tls_options] unless options[:tls_options].nil?
89
91
  @fluent_logger = ::Fluent::Logger::FluentLogger.new(nil, logger_opts)
90
92
  @severity = 0
91
93
  @log_tags = log_tags
@@ -1,3 +1,3 @@
1
1
  module ActFluentLoggerRails
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
data/spec/logger_spec.rb CHANGED
@@ -162,6 +162,43 @@ EOF
162
162
  end
163
163
  end
164
164
 
165
+ describe 'tls_options' do
166
+ context 'does not has key' do
167
+ before do
168
+ File.open(@config_file.path, 'w') do |f|
169
+ f.puts <<EOF
170
+ test:
171
+ fluent_host: '127.0.0.1'
172
+ fluent_port: 24224
173
+ tag: 'foo'
174
+ EOF
175
+ end
176
+ end
177
+ it do
178
+ expect(::Fluent::Logger::FluentLogger).not_to receive(:new).with(nil, hash_including(tls_options: { use_default_ca: true }))
179
+ logger
180
+ end
181
+ end
182
+ context 'has key' do
183
+ before do
184
+ File.open(@config_file.path, 'w') do |f|
185
+ f.puts <<EOF
186
+ test:
187
+ fluent_host: '127.0.0.1'
188
+ fluent_port: 24224
189
+ tag: 'foo'
190
+ tls_options:
191
+ use_default_ca: true
192
+ EOF
193
+ end
194
+ end
195
+ it do
196
+ expect(::Fluent::Logger::FluentLogger).to receive(:new).with(nil, hash_including(tls_options: { use_default_ca: true }))
197
+ logger
198
+ end
199
+ end
200
+ end
201
+
165
202
  describe 'severity_key' do
166
203
  describe 'not specified' do
167
204
  it 'severity' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: act-fluent-logger-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAHARA Yoshinori
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-03 00:00:00.000000000 Z
11
+ date: 2021-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -123,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.7.6
126
+ rubygems_version: 3.2.3
128
127
  signing_key:
129
128
  specification_version: 4
130
129
  summary: Fluent logger