Alternative to puts?
- Bamf
- Posts: 4
- Starts: 2
- Wiki Edits: 0
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?
- William
- Posts: 1063
- Starts: 32
- Wiki Edits: 56
Hi Bamf,
Try inserting something like this in your code:
logger.info "value of foo is: " + @foo.to_s
and then check your logs.
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
- Bamf
- Posts: 4
- Starts: 2
- Wiki Edits: 0
I got this in production.log:
NameError (undefined local variable or method `logger' for Flux::ControllerExtensions:Module)
NameError (undefined local variable or method `logger' for Flux::ControllerExtensions:Module)
2007-09-27 03:22 AM
- William
- Posts: 1063
- Starts: 32
- Wiki Edits: 56
Oh is this in a view?
Either way, try:
RAILS_DEFAULT_LOGGER.error "value of foo is: " + @foo.to_s
Either way, try:
RAILS_DEFAULT_LOGGER.error "value of foo is: " + @foo.to_s
2007-09-27 03:33 AM
- Bamf
- Posts: 4
- Starts: 2
- Wiki Edits: 0
Yes that one works, thanks!