logstasher
logstasher copied to clipboard
0.8 broken? Got spam in log
Hello! Last evening I've updated logstaher from 0.6.5 to 0.8 (even not thinking about it, just bundle update), and this morning I accidentally came to my Kibana instance that gathering logs from production, and ... WOW, 10 mil log entries! After update, logstaher has started to write some **** to logs like "null" and templates render messages. That was amazing experience. Please investigate :)
Here is my production.rb
config.logstasher.enabled = true
config.logstasher.suppress_app_log = false
config.logstasher.source = 'randewoo_production'
config.logstasher.logger_path = 'log/logstasher_production.log'
config.logstasher.backtrace = false
and initializer:
if LogStasher.enabled
LogStasher.add_custom_fields do |fields|
fields[:request_path] = request.path
fields[:site] = request.path =~ /^\/api/ ? 'api' : 'frontend'
controller = "#{params[:controller]}_params".gsub(/\//, '_')
fields[controller.to_sym] = params.reject { |k| ['controller', 'action'].include? k }
end
end
I've also seen these new template render messages when upgrading from 0.7.0 to 0.8.6
I did this in my config/logstasher.rb
::ActiveSupport::LogSubscriber.log_subscribers.each do |subscriber|
case subscriber.class.name
when 'LogStasher::ActionView::LogSubscriber'
LogStasher.unsubscribe(:action_view, subscriber)
when 'LogStasher::ActiveRecord::LogSubscriber'
LogStasher.unsubscribe(:active_record, subscriber)
end
end
Also a good idea due to #93