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

Feature request: disable logging in development if Rollbar is disabled #66

Closed
allspiritseve opened this issue Oct 8, 2013 · 9 comments

Comments

@allspiritseve
Copy link
Contributor

I have rollbar disabled in development, but any time there's an exception I get log messages like this:

[Rollbar] Reporting exception: undefined method `submissions' for nil:NilClass
[Rollbar] Exception not reported because Rollbar is disabled

It would be nice if there was a way to disable these as they clutter up my log file and are unnecessary if Rollbar is disabled.

@brianr
Copy link
Member

brianr commented Oct 8, 2013

Makes sense. Probably the way to do this is to implement a dummy object that can stand in as config.logger, and have an easy way to tell Rollbar to use it instead of the rails logger.

@allspiritseve
Copy link
Contributor Author

It doesn't look like the code is even using config.logger:

https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/exception_reporter.rb#L23-L29

I think the ideal solution would be requiring Rollbar to be included as Rack/Rails middleware in config/environments/*.rb or config/application.rb, so it just doesn't even get run in environments where it is disabled (Oink is an example of a gem that does this).

However, if there's a way to disable the logging in the configuration, that would be an acceptable compromise :)

@brianr
Copy link
Member

brianr commented Oct 10, 2013

Oh, good find; that should be using Rollbar.logger:

https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar.rb#L236-L242

(which also shouldn't be private).

@grosser
Copy link
Contributor

grosser commented Sep 11, 2014

👍

@kritik
Copy link

kritik commented Oct 20, 2014

+1 waiting for this feature. And I would also like to disable posting dev data even if Rollbar is enabled

@tisba
Copy link

tisba commented Mar 8, 2015

Any news on this one? I actually would like to disable (or redirect) Rollbar logging in production as well (even if Rollbar reporting is enabled).

We are logging JSON-lines to be processed with Logstash. Rollbar's logging is quite annoying and messes up the logs.

@jondeandres
Copy link
Contributor

@tisba we didn't work on this yet, but you could always set config.logger to an instance of NullLogger like this one, https://github.com/rack/rack/blob/master/lib/rack/nulllogger.rb.

So depending on the environment you are, you can set that logger or not. We'll try to find a configuration solution for this or perhaps adding or not the middleware to the stack.

@tamvm
Copy link

tamvm commented May 9, 2015

Any progress for this issue? It's still open for long time

@fagiani
Copy link

fagiani commented Mar 26, 2016

Bump! any hope for this?

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

No branches or pull requests

8 participants