Silence Logger?
** [Airbrake] Success: Net::HTTPOK
** [Airbrake] Environment Info: [Ruby: 1.8.7] [Rails: 3.0.14] [Env: production]
** [Airbrake] Response from Airbrake:
<notice>
....
can you really not silence the logger? i looked through the source, and it seems that rack.rb and rails.rb have different ways of configuring the logger, and further airbrake.rb and sender.rb have different was of accessing the logger. and none of it is very friendly to any sort of configuration. i'm shutting these up with the following code for now. but i'd rather the gem wasn't assuming it's OK to scribble to STDOUT.
module Airbrake # v3.1.2
class << self
def write_verbose_log(*args);end
end
class Sender
def log(*args);end
end
end
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Morgan on 04 Aug, 2012 12:47 AM
Hello,
Thank you for raising your issue to our attention. There is not currently a way to easily silence the writing to STDOUT I will raise this issue to the development team's attention for consideration. Thank you for your feedback and patience!
From,
Morgan
Support Staff 3 Posted by Herb on 04 Aug, 2012 01:13 AM
Agreed, I'll add an option for that in configuration so it's more flexible.
Thanks for sharing this with us!
Herb closed this discussion on 04 Aug, 2012 01:13 AM.
Herb re-opened this discussion on 05 Aug, 2012 10:10 PM
Support Staff 4 Posted by Herb on 05 Aug, 2012 10:10 PM
Hey Chris,
the option is already added, but it's not mentioned in the readme, so I've forgot about that.
You don't need to do this sort of monkeypatches to achieve this. Airbrake uses the same logger as your Rails application by default, presumably
STDOUT. You can use a different logger to distinguish information related only to Airbrake by using a different logger:Where
log/airbrake.logis the location of your preferred log file. Just make sure you pass the Logger instance and everything should work as expected.I'm adding this info to readme, thank you for bringing this up! :)
Morgan closed this discussion on 04 Oct, 2012 12:54 AM.