# Logging with the daemons gem

**URL:** <https://www.ruby-forum.com/t/logging-with-the-daemons-gem/168318>\
**Category:** Rails\
**Created:** [May 19, 2009, 3:49pm UTC](https://www.ruby-forum.com/t/logging-with-the-daemons-gem/168318 "2009-05-19T15:49:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyr0](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/da6949/32.png) [@pyr0](https://www.ruby-forum.com/u/pyr0)\
**Post date:** [May 19, 2009, 3:49pm UTC](https://www.ruby-forum.com/t/logging-with-the-daemons-gem/168318/1 "2009-05-19T15:49:27Z")

</div>

I am trying to leverage the daemons gem but I am confused about the  
proper way to set up logging. I am able pass options which configure  
stdout to go to a log file but it seems like all calls to Rails.logger  
are disabled as I see the following message in my output:

usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/  
active\_support/buffered\_logger.rb:99:in `write': closed stream (IOError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/ lib/active_support/buffered_logger.rb:99:in`flush’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/  
lib/active\_support/buffered\_logger.rb:96:in `synchronize' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/ lib/active_support/buffered_logger.rb:96:in`flush’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/  
lib/active\_support/buffered\_logger.rb:116:in `auto\_flush’

This doesn’t seem right as my daemon is reusing code that makes calls  
to Rails.logger. Am I missing something?

thx.

---

<div class="post-metadata">

**Author:** ![pyr0](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/da6949/32.png) [@pyr0](https://www.ruby-forum.com/u/pyr0)\
**Post date:** [June 4, 2009, 8:30am UTC](https://www.ruby-forum.com/t/logging-with-the-daemons-gem/168318/2 "2009-06-04T08:30:29Z")

</div>

Karl B. wrote:

> I am trying to leverage the daemons gem but I am confused about the  
> proper way to set up logging. I am able pass options which configure  
> stdout to go to a log file but it seems like all calls to Rails.logger  
> are disabled as I see the following message in my output:
> 
> usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/  
> active\_support/buffered\_logger.rb:99:in `write': closed stream (IOError) from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/ lib/active_support/buffered_logger.rb:99:in`flush’  
> from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/  
> lib/active\_support/buffered\_logger.rb:96:in `synchronize' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/ lib/active_support/buffered_logger.rb:96:in`flush’  
> from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/  
> lib/active\_support/buffered\_logger.rb:116:in `auto\_flush’
> 
> This doesn’t seem right as my daemon is reusing code that makes calls  
> to Rails.logger. Am I missing something?
> 
> thx.

Did you get this resolved? I’m in a similar situation: Trying to use  
Rails’ logger from within a daemon.

Thanks,  
Chris
