I am using the raven with Rails.
In dev environment, I have purposely unset the DSN.
But everytime there is an error, this message is printed -
<Error> excluded from capture: DSN not set
Additionally the error gets reprinted after this as well.
How to silence the raven log?
Raven's logger level can be changed:
Raven.configure do |config|
logger = ::Raven::Logger.new(STDOUT)
logger.level = "error"
config.logger = logger
end
would be great if one could disable raven through the configuration options.
Yeah it would. I do the same by not setting the DSN
On Tue, Jan 16, 2018 at 2:43 PM Peter Schröder notifications@github.com
wrote:
would be great if one could disable raven through the configuration
options.—
You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub
https://github.com/getsentry/raven-ruby/issues/793#issuecomment-357897977,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFbWQE66w3yiM4sbz9vqBDZmRjDO5xNTks5tLGg8gaJpZM4Qdchs
.
looks like this is the workaround. don't like it though
if one could disable raven through the configuration options.
You can change the environment settings or not set the DSN.
I'm sorry for reviving this ticket:
@nateberkopec so far I have
config.dsnSENTRY_DSNand even
Raven.configure-block at allBut in all cases I still see excluded from capture: DSN not set in the development environment.
Why's that? Well, here's why:
It's simply buggy. I'm just setting the DSN in production and staging which totally makes sense because I only want to catch Sentry errors in those two environments. It shouldn't do anything in other environments (not even a single output).
There's a useful method Configuration#capture_in_current_environment? but due to the order in Configuration#capture_allowed? this leads to a situation that the relevant part (Configuration#capture_in_current_environment?) won't even be reached.
Because, although totally irrelevant in this case, Configuration#valid? will be called _first_ and adds DSN not set to @errors and returns false.
So this irrelevant "error" will appear to the log and Configuration#capture_in_current_environment? won't even be touched although it's the _only_ relevant thing here. And even if we would switch and call Configuration#valid? and Configuration#capture_in_current_environment? we would see excluded from capture: Not configured to send/capture in environment 'development' in the logs. Which we know, because we set it _explicitly_ that way, so it is definitely not an error although it is added to @errors.
Also the README is therefore misleading. The headline Raven only runs when SENTRY_DSN is set is not quite true. Raven just _sends_ stuff when the dsn is set, but it will _still pollute the logs_.
Furthermore increasing the log level in development environment is obviously not a bugfix. Actually it might even be the environment where you actually want debug output. When you want to have it activated, even from Raven.
Otherwise I just might have missed a detail and I would be happy to know which one. Because I guess it must somehow be easy to just silence Raven somehow, when it isn't wanted.
Or maybe it's just the definition of errors that is somehow bothering? Why should it be an error, that a user defined the development environment as non-capturable?
PS: isn't this a duplicate of #539 ?
Following this up as agree with @alexanderadam - this definitely not a duplicate of #539 and IMHO needs to be re-opened as definitely a bug.
The documentation says "Don't set the DSN and Raven is disabled" but then Raven sits there going "waaah you didn't set the DSN!" into my logs :-)
I want to be able to _turn Raven off_ and be sure it's turned off in e.g. dev or test modes. I don't want to see warning-like stuff catching my attention in logs as it's distracting me from other potentially significant actual warning-like stuff therein.
Would love to see this reopened & fixed if at all possible. Thanks!
Hi thanks for all the discussions, https://github.com/getsentry/raven-ruby/pull/1000 should fix the issue 😄
Most helpful comment
Following this up as agree with @alexanderadam - this definitely not a duplicate of #539 and IMHO needs to be re-opened as definitely a bug.
The documentation says "Don't set the DSN and Raven is disabled" but then Raven sits there going "waaah you didn't set the DSN!" into my logs :-)
I want to be able to _turn Raven off_ and be sure it's turned off in e.g. dev or test modes. I don't want to see warning-like stuff catching my attention in logs as it's distracting me from other potentially significant actual warning-like stuff therein.
Would love to see this reopened & fixed if at all possible. Thanks!