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?
Hi Mark,
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 :>).
--
Eric Wong