fluent-plugin-mongo 0.7.1 → 0.7.2

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
  SHA1:
3
- metadata.gz: 223d88d3a35d00c18254bda1ffe8320900a5e76a
4
- data.tar.gz: 5581a2106b77d3797dd6f0e67310a7e21305aafa
3
+ metadata.gz: 704336957f5f5ebdec8351e961f38555db15ce16
4
+ data.tar.gz: f8dc945869ddf4c3e8125b517757371b86067c3d
5
5
  SHA512:
6
- metadata.gz: a0b6292750fb0bcad9079ee182591fa6b0ac35d009931b240b7d5403890f22955df8f7f45782b476f1160e10ebf2f92b5e19dc525b937e151eb200d7de8e1aaa
7
- data.tar.gz: 8ff33a0383a02d5b6b34418b9738a1afbd527eaaab67b33e9bc334e73854d3859eaaa4386215bab455fa0638ce6def3a6822b92a516b7f68a596d2a9a34fef4e
6
+ metadata.gz: aad06123bf520927bba1e718efaf297f379c98419ce7dc6d1068d2da9a0b86b40d291b017b2d0dfd1b1cb9fc72e766d7f82884e5f7248790fbce47197612b703
7
+ data.tar.gz: 9b18985959ec858e77680ca8bf21037cfb2b62461f427889c03d5166e156617492d8ceda492a1d2598e44f18c30e14d745708c1136d6fe0260808e90ca300959
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Release 0.7.2 - 2014/02/05
2
+
3
+ * Support log_level option
4
+
5
+
1
6
  Release 0.7.1 - 2013/07/31
2
7
 
3
8
  * Fix incomprehensible code indent
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.7.2
@@ -19,6 +19,10 @@ module Fluent
19
19
  # To store last ObjectID
20
20
  config_param :id_store_file, :string, :default => nil
21
21
 
22
+ unless method_defined?(:log)
23
+ define_method(:log) { $log }
24
+ end
25
+
22
26
  def initialize
23
27
  super
24
28
  require 'mongo'
@@ -71,10 +75,10 @@ module Fluent
71
75
  raise ConfigError, "'#{@database}.#{@collection}' is not capped: node = #{@host}:#{@port}" unless collection.capped?
72
76
  collection
73
77
  rescue Mongo::ConnectionFailure => e
74
- $log.fatal "Failed to connect to 'mongod'. Please restart 'fluentd' after 'mongod' started: #{e}"
78
+ log.fatal "Failed to connect to 'mongod'. Please restart 'fluentd' after 'mongod' started: #{e}"
75
79
  exit!
76
80
  rescue Mongo::OperationFailure => e
77
- $log.fatal "Operation failed. Probably, 'mongod' needs an authentication: #{e}"
81
+ log.fatal "Operation failed. Probably, 'mongod' needs an authentication: #{e}"
78
82
  exit!
79
83
  end
80
84
  end
@@ -14,7 +14,7 @@ module MongoUtil
14
14
  begin
15
15
  db.authenticate(@user, @password)
16
16
  rescue Mongo::AuthenticationError => e
17
- $log.fatal e
17
+ log.fatal e
18
18
  exit!
19
19
  end
20
20
  end
@@ -26,6 +26,10 @@ module Fluent
26
26
 
27
27
  attr_reader :collection_options, :connection_options
28
28
 
29
+ unless method_defined?(:log)
30
+ define_method(:log) { $log }
31
+ end
32
+
29
33
  def initialize
30
34
  super
31
35
  require 'mongo'
@@ -201,18 +205,18 @@ module Fluent
201
205
  begin
202
206
  limit = mongod_version >= "1.8.0" ? LIMIT_AFTER_v1_8 : LIMIT_BEFORE_v1_8
203
207
  rescue Mongo::ConnectionFailure => e
204
- $log.fatal "Failed to connect to 'mongod'. Please restart 'fluentd' after 'mongod' started: #{e}"
208
+ log.fatal "Failed to connect to 'mongod'. Please restart 'fluentd' after 'mongod' started: #{e}"
205
209
  exit!
206
210
  rescue Mongo::OperationFailure => e
207
- $log.fatal "Operation failed. Probably, 'mongod' needs an authentication: #{e}"
211
+ log.fatal "Operation failed. Probably, 'mongod' needs an authentication: #{e}"
208
212
  exit!
209
213
  rescue Exception => e
210
- $log.warn "mongo unknown error #{e}, set #{LIMIT_BEFORE_v1_8} to chunk limit"
214
+ log.warn "mongo unknown error #{e}, set #{LIMIT_BEFORE_v1_8} to chunk limit"
211
215
  limit = LIMIT_BEFORE_v1_8
212
216
  end
213
217
 
214
218
  if @buffer.buffer_chunk_limit > limit
215
- $log.warn ":buffer_chunk_limit(#{@buffer.buffer_chunk_limit}) is large. Reset :buffer_chunk_limit with #{limit}"
219
+ log.warn ":buffer_chunk_limit(#{@buffer.buffer_chunk_limit}) is large. Reset :buffer_chunk_limit with #{limit}"
216
220
  limit
217
221
  else
218
222
  @buffer.buffer_chunk_limit
@@ -60,7 +60,7 @@ module Fluent
60
60
  retries += 1
61
61
  raise e if retries > @num_retries
62
62
 
63
- $log.warn "Failed to connect to Replica Set. Try to retry: retry number = #{retries}"
63
+ log.warn "Failed to connect to Replica Set. Try to retry: retry number = #{retries}"
64
64
  sleep 0.5
65
65
  retry
66
66
  end
@@ -14,7 +14,7 @@ module Fluent
14
14
  @remove_tag_prefix = Regexp.new('^' + Regexp.escape(remove_prefix_collection))
15
15
  end
16
16
 
17
- $log.warn "'mongo_tag_collection' deprecated. Please use 'mongo' type with 'tag_mapped' parameter"
17
+ log.warn "'mongo_tag_collection' deprecated. Please use 'mongo' type with 'tag_mapped' parameter"
18
18
  end
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mongo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Nakagawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-31 00:00:00.000000000 Z
11
+ date: 2014-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd