Welcome Guest | Login

Alternative to puts?

I'm currently troubleshooting my newly deployed app, and I need to somehow see the value of a variable before the application errors out.  Since I can't use puts, how would I do this?  I've tried using $stderr.puts and I can't seem to find the output in any of the logs.  Any ideas?

2007-09-27 02:54 AM

Hi Bamf,

Try inserting something like this in your code:

logger.info "value of foo is: " + @foo.to_s  

and then check your logs.  

2007-09-27 03:11 AM

I got this in production.log:

NameError (undefined local variable or method `logger' for Flux::ControllerExtensions:Module)

2007-09-27 03:22 AM

Oh is this in a view?  

Either way, try:

RAILS_DEFAULT_LOGGER.error "value of foo is: " + @foo.to_s

2007-09-27 03:33 AM

Yes that one works, thanks!

2007-09-27 03:46 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.