Skip to content

Commit f668c75

Browse files
author
Pere Urbon-Bayes
committed
expose the sql log level as defined by the internal sequel library, this lets you control how much information is logged out of each statements executed
1 parent 2126ed9 commit f668c75

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/logstash/plugin_mixins/jdbc.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ def setup_jdbc_config
7272
# examples of vendor-specific options can be found in this
7373
# documentation page: https://github.com/jeremyevans/sequel/blob/master/doc/opening_databases.rdoc
7474
config :sequel_opts, :validate => :hash, :default => {}
75+
76+
# Log level at which to log SQL queries. The default value is info.
77+
config :sql_log_level, :validate => :string, :default => "info"
7578
end
7679

7780
private
@@ -122,7 +125,7 @@ def prepare_jdbc_connection
122125
#TODO return false and let the plugin raise a LogStash::ConfigurationError
123126
raise e
124127
end
125-
128+
@database.sql_log_level = @sql_log_level.to_sym
126129
@sql_last_start = Time.at(0).utc
127130
end # def prepare_jdbc_connection
128131

0 commit comments

Comments
 (0)