diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b86b93..090bb9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Change Log All notable changes to this project will be documented in this file, from 0.2.0. +## [0.2.10] - 2016-07-07 + - Support non-string entries in statement array + - Adds backtrace to exception logging + ## [0.2.9] - 2016-06-29 - Fix NameError exception. - Moved log_jdbc_exception calls diff --git a/lib/logstash/outputs/jdbc.rb b/lib/logstash/outputs/jdbc.rb index 80fa125..3873235 100644 --- a/lib/logstash/outputs/jdbc.rb +++ b/lib/logstash/outputs/jdbc.rb @@ -286,14 +286,15 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base def add_statement_event_params(statement, event) @statement[1..-1].each_with_index do |i, idx| - value = event[i] - - value = if value.nil? and i.to_s =~ /%{/ - event.sprintf(i) - else - value - end - + if i.is_a? String + value = event[i] + if value.nil? and i =~ /%\{/ + value = event.sprintf(i) + end + else + value = i + end + case value when Time # See LogStash::Timestamp, below, for the why behind strftime. @@ -323,6 +324,7 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base statement end + def log_jdbc_exception(exception, retrying) current_exception = exception log_text = 'JDBC - Exception. ' + (retrying ? 'Retrying' : 'Not retrying') + '.'