Gathering statistics

In my production.log file, I’m only seeing errors and database queries,

How should I go about generating an access.log and error.log (similar
to apache). I’m interested in seeing the usual stats, request,
referer, host, user-agent.

Anthony E.

That’s all the responsibility of whatever http server you’re running.
production.log is purely what Rails itself does.

This would be for mongrel then…

On Mon, Jul 14, 2008 at 12:21 PM, Jason R. [email protected]

referer, host, user-agent.

Anthony E.

Hmm, no, not mongrel, something like Apache, nginx, lighttp, etc.
These are your front-end http servers, and they proxy down into
Mongrel for running your Rails site.


Not using those, I’m using mongrel stand alone, as suggested in the
Deployment book.

On Mon, Jul 14, 2008 at 2:10 PM, Jason R. [email protected]


Anthony E.

which deployment book? i would be surprised if a book about deploying
on rails suggests that you run mongrel alone in production. most
that I’ve seen suggest apache or nginx proxying to mongrel. often it is
proxying to a cluster of mongrels. for one reason, mongrel is slow at
serving static files. also another issue of running mongrel alone, is
a mongrel can only deal with one request at a time, so of there are any
tasks that are a little long, it will block other tasks from being run.
this is why people use load-balancers to proxy to mongrel. also, using
apache or nginx gives you the logs that you are looking for. nice.

anyway, here are a few links:

here is a nice book that covers a lot about rails deployment:

hope this helps,

On Tue, Jul 15, 2008 at 5:15 AM, Anthony E. [email protected]


Having Mongrel (Thin, or whatever) standing alone, not proxied

behind a full fledged web server is unusual but it works.

If you have a box with plenty of resources and a bunch of small

apps servicing not so many requests, adding a reverse proxy
arquitecture and clusters is overarquitecting.

But yes, it is unusual and if you want to gather webserver like

stats it would be better to install nginx, or you weapon of choice,
and let it take care of logging and also serving the static files.

Aníbal Rojas

On Jul 15, 9:01 pm, “Scott Ballantyne” [email protected]