Debug output cannot be disabled #14

Closed
martinstreicher opened this Issue Nov 20, 2012 · 4 comments

Projects

None yet

4 participants

@martinstreicher

The gem seemingly always creates a logger. On a busy API server, the log quickly grew due to four lines of text each request.

@dsjoerg
dsjoerg commented Nov 26, 2012

+1, I've been struggling with the same nonsense. It doesnt always create a logger, it will use the one in env['rack.logger'] if it exists, as it will if you're using unicorn.

If you can manage to throw this line into your unicorn.conf, then the log.debug() calls won't clutter up your logfile:

logger Logger.new($stderr).tap{|logger| logger.level = Logger::INFO}
@fx
fx commented Nov 28, 2012

To stop it from using the unicorn-assigned rack.logger or creating a new one, simply tell Rack::Cors to use a different logger via the logger option: https://github.com/cyu/rack-cors/blob/master/lib/rack/cors.rb#L07

@cyu
Owner
cyu commented Nov 28, 2012

@fx: Great point - that's probably the best way to get around this right now. I plan on putting some time in an knocking out some issues. I'll get this addressed in the next release.

@cyu cyu was assigned Dec 9, 2012
@cyu
Owner
cyu commented Dec 9, 2012

Add :debug option which will disable debug logging

@cyu cyu closed this Dec 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment