Skip to content

Commit 49cb08f

Browse files
authored
Merge pull request #291 from yaauie/charset-converter-logger
connect our logger up to the charset converters
2 parents 37c9073 + 199cc7b commit 49cb08f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/logstash/inputs/jdbc.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,14 @@ def register
230230
@jdbc_password = LogStash::Util::Password.new(File.read(@jdbc_password_filepath).strip) if @jdbc_password_filepath
231231

232232
if enable_encoding?
233-
@converters = {}
234-
@columns_charset.each do |column_name, encoding|
235-
@converters[encoding] = LogStash::Util::Charset.new(encoding)
233+
encodings = @columns_charset.values
234+
encodings << @charset if @charset
235+
236+
@converters = encodings.each_with_object({}) do |encoding, converters|
237+
converter = LogStash::Util::Charset.new(encoding)
238+
converter.logger = self.logger
239+
converters[encoding] = converter
236240
end
237-
@converters[@charset] = LogStash::Util::Charset.new(@charset) if @charset
238241
end
239242
end # def register
240243

0 commit comments

Comments
 (0)