LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Unable to log to STDOUT from Ruby/Rails when running under LiteSpeed

Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2006, 04:25 PM
dirkbj dirkbj is offline
Member
 
Join Date: Oct 2006
Posts: 16
Default Unable to log to STDOUT from Ruby/Rails when running under LiteSpeed

I have the following code in my Rails app:


require 'logger'

QGV_LOGGER = Logger.new(STDOUT)

QGV_LOGGER.info "Logging engaged in #{RAILS_ENV} Rails environment"


This runs fine when run using WEBrick, however, when run using LS 2.2.4, I get a "Broken Pipe" error.

Does LS deny me access to STDOUT in Rails?

Dirk
Reply With Quote
  #2  
Old 11-02-2006, 11:44 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Where does the log message go when logging to STDOUT? WEBrink console?
I tried your code in a controller, it works, message goes to the production.log.
Reply With Quote
  #3  
Old 11-02-2006, 11:52 AM
dirkbj dirkbj is offline
Member
 
Join Date: Oct 2006
Posts: 16
Default re: Unable to log to STOUT from Ruby/Rails when running under LiteSpeed

Sorry I wasn't clearer. The error is a Rails error, so the logging goes nowhere... it is as if STDOUT is not a valid File pointer.
Reply With Quote
  #4  
Old 11-02-2006, 12:12 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
I added the code in the first post inside a controller class of a test rails application. It works, and the log message goes into log/production.log.

I wonder where you put those code to break rails?
Reply With Quote
  #5  
Old 11-02-2006, 12:25 PM
dirkbj dirkbj is offline
Member
 
Join Date: Oct 2006
Posts: 16
Default re: Unable to log to STDOUT from Ruby/Rails when running under LiteSpeed

Good question. I actually have the code in a class that doesn not inherit from any Rails class:


class QuestionGroupValidator
require 'logger'

attr_accessor :validation_string

QGV_LOGGER = Logger.new(STDOUT)

QGV_LOGGER.info "Logging engaged in #{RAILS_ENV} Rails environment"

#....
end


Thanks for the help!

Dirk
Reply With Quote
  #6  
Old 11-15-2006, 10:03 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Still not able to reproduce the problem here.

I think it might happen during Rails framework initialization, after the framework has been fully initialized, it just works fine.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:15 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.