This commit is contained in:
Karl Southern 2016-07-07 11:03:14 +01:00
parent b10462dacd
commit da5a3d8be3
2 changed files with 14 additions and 8 deletions

View File

@ -1,6 +1,10 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file, from 0.2.0. 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 ## [0.2.9] - 2016-06-29
- Fix NameError exception. - Fix NameError exception.
- Moved log_jdbc_exception calls - Moved log_jdbc_exception calls

View File

@ -286,12 +286,13 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
def add_statement_event_params(statement, event) def add_statement_event_params(statement, event)
@statement[1..-1].each_with_index do |i, idx| @statement[1..-1].each_with_index do |i, idx|
if i.is_a? String
value = event[i] value = event[i]
if value.nil? and i =~ /%\{/
value = if value.nil? and i.to_s =~ /%{/ value = event.sprintf(i)
event.sprintf(i) end
else else
value value = i
end end
case value case value
@ -323,6 +324,7 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
statement statement
end end
def log_jdbc_exception(exception, retrying) def log_jdbc_exception(exception, retrying)
current_exception = exception current_exception = exception
log_text = 'JDBC - Exception. ' + (retrying ? 'Retrying' : 'Not retrying') + '.' log_text = 'JDBC - Exception. ' + (retrying ? 'Retrying' : 'Not retrying') + '.'