# Gathering statistics

**URL:** <https://www.ruby-forum.com/t/gathering-statistics/143051>\
**Category:** Deployment\
**Created:** [July 14, 2008, 8:38pm UTC](https://www.ruby-forum.com/t/gathering-statistics/143051 "2008-07-14T20:38:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [July 14, 2008, 8:38pm UTC](https://www.ruby-forum.com/t/gathering-statistics/143051/1 "2008-07-14T20:38:35Z")

</div>

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

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.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [July 14, 2008, 9:21pm UTC](https://www.ruby-forum.com/t/gathering-statistics/143051/2 "2008-07-14T21:21:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [July 14, 2008, 11:02pm UTC](https://www.ruby-forum.com/t/gathering-statistics/143051/3 "2008-07-14T23:02:50Z")

</div>

This would be for mongrel then…

On Mon, Jul 14, 2008 at 12:21 PM, Jason R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > referer, host, user-agent.
> 
> >

–  
Anthony E.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [July 14, 2008, 11:11pm UTC](https://www.ruby-forum.com/t/gathering-statistics/143051/4 "2008-07-14T23:11:37Z")

</div>

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.

Jason

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [July 14, 2008, 11:16pm UTC](https://www.ruby-forum.com/t/gathering-statistics/143051/5 "2008-07-14T23:16:53Z")

</div>

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. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > >
> > 
> > 408-656-2473  
> > [http://anthony.ettinger.name](http://anthony.ettinger.name)
> > 
> > >
> 
> >

–  
Anthony E.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [July 15, 2008, 4:03am UTC](https://www.ruby-forum.com/t/gathering-statistics/143051/6 "2008-07-15T04:03:01Z")

</div>

which deployment book? i would be surprised if a book about deploying  
ruby  
on rails suggests that you run mongrel alone in production. most  
resources  
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  
that  
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:  
[http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/](http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/)

> **[apache proxy balancer + mongrel clusters and deploying application with...](https://webonrails.com/2007/02/04/apache-proxy-balancer-mongrel-clusters-and-deploying-application-with-capistrano/)**
>
> How to setup or deploy rails application with mongrel cluster and apache proxy balancer?

[http://jonathan.tron.name/2006/07/26/apache-2-0-x-mongrel-mod\_proxy-mod\_rewrite-configuration](http://jonathan.tron.name/2006/07/26/apache-2-0-x-mongrel-mod_proxy-mod_rewrite-configuration)

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

> **[Pragmatic Bookshelf: By Developers, For Developers](https://pragprog.com)**
>
> We improve the lives of professional developers. We create timely, practical books on classic and cutting-edge topics to help you learn and practice your craft, and accelerate your career. Come learn with us.

hope this helps,  
scott

On Tue, Jul 15, 2008 at 5:15 AM, Anthony E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [July 16, 2008, 1:57pm UTC](https://www.ruby-forum.com/t/gathering-statistics/143051/7 "2008-07-16T13:57:19Z")

</div>

Scott,

```
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

> **[Home - Has Many Developers](https://hasmanydevelopers.com/)**
>
> We are the best choice for your building design and development

> **[RUBYCORNER.COM](https://www.rubycorner.com/)**
>
> RUBYCORNER.COM - Contact us for any business inquiries

[http://anibal.rojas.com.ve](http://anibal.rojas.com.ve)

On Jul 15, 9:01 pm, “Scott Ballantyne” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
