# Split or Multiple logs?

**URL:** <https://www.ruby-forum.com/t/split-or-multiple-logs/192835>\
**Category:** Rails\
**Created:** [August 6, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/split-or-multiple-logs/192835 "2010-08-06T18:24:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danimal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bb73d2/32.png) [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Post date:** [August 6, 2010, 6:24pm UTC](https://www.ruby-forum.com/t/split-or-multiple-logs/192835/1 "2010-08-06T18:24:56Z")

</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](http://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:** ![Danimal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bb73d2/32.png) [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Post date:** [August 6, 2010, 7:27pm UTC](https://www.ruby-forum.com/t/split-or-multiple-logs/192835/2 "2010-08-06T19: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](http://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,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Danimal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bb73d2/32.png) [@Danimal](https://www.ruby-forum.com/u/Danimal)\
**Post date:** [September 2, 2010, 3:10pm UTC](https://www.ruby-forum.com/t/split-or-multiple-logs/192835/3 "2010-09-02T15:10:06Z")

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