Forum: Ruby on Rails logging with the daemons gem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1a6c6f6af9928f1851b5fd63849b1d23?d=identicon&s=25 Karl Baum (Guest)
on 2009-05-19 15:49
(Received via mailing list)
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.
190c84aff72f9f8501f5b182490c2a19?d=identicon&s=25 Chris Johnson (ujohnc00)
on 2009-06-04 08:30
Karl Baum 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
This topic is locked and can not be replied to.