Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8 broken? Got spam in log #90

Open
ex0rcist opened this issue Oct 27, 2015 · 2 comments
Open

0.8 broken? Got spam in log #90

ex0rcist opened this issue Oct 27, 2015 · 2 comments

Comments

@ex0rcist
Copy link

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
@davidbasalla
Copy link

I've also seen these new template render messages when upgrading from 0.7.0 to 0.8.6

@ctaintor
Copy link

ctaintor commented Dec 5, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants