lib/logstash/inputs/jdbc.rb in logstash-input-jdbc-4.3.9 vs lib/logstash/inputs/jdbc.rb in logstash-input-jdbc-4.3.11

- old
+ new

@@ -228,14 +228,17 @@ end @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 def run(queue) if @schedule