[Rails 3] Unicorn log output
normalperson at yhbt.net
Tue Jul 6 05:06:43 EDT 2010
Mark Davidson <chemosh9 at gmail.com> wrote:
> I'm just getting started with Rails 3 but noticed that unicorn doesn't
> tail the development log which makes sense since its not specifically
> for rails. I got the development log back using Rails::Rack::LogTailer
> and got rid of the Rack request log by setting `stderr_path` to
> /dev/null in the unicorn config file. That basically gives me the same
> behavior as unicorn_rails on 2.3.8.
> Is there a better or preferred way of doing this? Can Rack's default
> request log be disabled? I wonder why it goes to stderr anyway, cause
> the request log isn't exactly an error?
You can pass "-E none" or set "RACK_ENV=none" in the environment to
disable the default middleware 'unicorn' gives you.
'unicorn' tries to follow the 'rackup' command as closely as possible to
ease transitions, so it will send Rack::CommonLogger output to $stderr
when RACK_ENV is 'none' or 'deployment' just like 'rackup' does.
On the subject of request logging, I prefer to use Clogger
(http://clogger.rubyforge.org/) for the few deployments I do instead of
Rack::CommonLogger since Clogger is configurable and (under MRI) faster
(I also wrote it, so if it breaks I get to fix it :>).
More information about the mongrel-unicorn