Skip to content

Commit

Permalink
Merge pull request #291 from yaauie/charset-converter-logger
Browse files Browse the repository at this point in the history
connect our logger up to the charset converters
  • Loading branch information
yaauie authored Jul 20, 2018
2 parents 37c9073 + 199cc7b commit 49cb08f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/logstash/inputs/jdbc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,14 @@ def register
@jdbc_password = LogStash::Util::Password.new(File.read(@jdbc_password_filepath).strip) if @jdbc_password_filepath

if enable_encoding?
@converters = {}
@columns_charset.each do |column_name, encoding|
@converters[encoding] = LogStash::Util::Charset.new(encoding)
encodings = @columns_charset.values
encodings << @charset if @charset

@converters = encodings.each_with_object({}) do |encoding, converters|
converter = LogStash::Util::Charset.new(encoding)
converter.logger = self.logger
converters[encoding] = converter
end
@converters[@charset] = LogStash::Util::Charset.new(@charset) if @charset
end
end # def register

Expand Down

0 comments on commit 49cb08f

Please sign in to comment.