# Split or Multiple logs?

**URL:** <https://discuss.rubyonrails.org/t/split-or-multiple-logs/53442>\
**Category:** rubyonrails-talk\
**Created:** [August 6, 2010, 4:24pm UTC](https://discuss.rubyonrails.org/t/split-or-multiple-logs/53442 "2010-08-06T16:24:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Sharp](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dan\_Sharp](https://discuss.rubyonrails.org/u/Dan_Sharp)\
**Post date:** [August 6, 2010, 4:24pm UTC](https://discuss.rubyonrails.org/t/split-or-multiple-logs/53442/1 "2010-08-06T16:24:03Z")

</div>

Hi all!

If you have a rails app using multiple subdomains (or domains), is it possible to split the production.log file into specific log files per domain? I.e.: production\_subdomain1.log, production\_subdomain2.log, etc? A visit to subdomain1.myapp.com would write to the production\_subdomain1.log file, for example.

Thoughts? Advice? Anyone done something like this?

Thanks,

-Danimal

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [August 6, 2010, 5:27pm UTC](https://discuss.rubyonrails.org/t/split-or-multiple-logs/53442/2 "2010-08-06T17:27:18Z")

</div>

Danimal wrote:

> Hi all!
> 
> If you have a rails app using multiple subdomains (or domains), is it possible to split the production.log file into specific log files per domain? I.e.: production\_subdomain1.log, production\_subdomain2.log, etc? A visit to subdomain1.myapp.com would write to the production\_subdomain1.log file, for example.
> 
> Thoughts? Advice? Anyone done something like this?

Why not use a log analyzer for this?

> Thanks,
> 
> -Danimal

Best,

---

<div class="post-metadata">

**Author:** ![Dan\_Sharp](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Dan\_Sharp](https://discuss.rubyonrails.org/u/Dan_Sharp)\
**Post date:** [September 2, 2010, 1:08pm UTC](https://discuss.rubyonrails.org/t/split-or-multiple-logs/53442/3 "2010-09-02T13:08:47Z")

</div>

Hi Marnen!

Thanks for the reply.

A log analyzer would help, of course, but we often find the need to read through a log file directly. The problem with multiple subdomains in a single log file, is actions on one subdomain inter-mesh with actions on another, so reading sequentially becomes very hard.

It seems like it would be neat and clean to simply have separate log files per subdomain.

I would be open to suggestions on good log analyzers. We run NginX proxying to Thin.

Thanks,

-Danimal
