I posted this to the discussion forum on rubyforge.org, but it appears that it would have been better to post here. Does anyone have any advice on how to resolve the problem reported at http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145? Thanks, Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061106/ee028807/attachment.html
On 11/6/06, Justin Johnson <justinjohnson at gmail.com> wrote:> Does anyone have any advice on how to resolve the problem reported at > http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145You are running a service that does not have STDIN, STDOUT nor STDERR, therefore you cannot write to them. If you want to debug, I suggest opening a file (local file, service doesn''t ''see'' substs or network drives) and writing to that. Maybe Logger or Log4r would be useful. Another possibility is to use OutputDebugString and DbgView[1], but I''m not sure if service is allowed to call it. require ''Win32API'' module Windows module Debug OutputDebugString = Win32API.new(''kernel32'', ''OutputDebugStringA'', ''P'', ''V'') def OutputDebugString(message) OutputDebugString.call(message) end end end [1] http://www.sysinternals.com/Utilities/DebugView.html
On 11/6/06, Jan Svitok <jan.svitok at gmail.com> wrote:> On 11/6/06, Justin Johnson <justinjohnson at gmail.com> wrote: > > Does anyone have any advice on how to resolve the problem reported at > > http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145 > > You are running a service that does not have STDIN, STDOUT nor STDERR, > therefore you cannot write to them. If you want to debug, I suggest > opening a file (local file, service doesn''t ''see'' substs or network > drives) and writing to that. Maybe Logger or Log4r would be useful. > > Another possibility is to use OutputDebugString and DbgView[1], but > I''m not sure if service is allowed to call it. > > require ''Win32API'' > > module Windows > module Debug > OutputDebugString = Win32API.new(''kernel32'', > ''OutputDebugStringA'', ''P'', ''V'') > def OutputDebugString(message) > OutputDebugString.call(message) > end > end > end > > [1] http://www.sysinternals.com/Utilities/DebugView.htmlYeah, and while we are at it, few more hints: - check Rails'' debugging facilities, AWDWR sections 13.6 and 13.7. Basically you can do logger.warn "message", logger.info "message", logger.error "message", logger.fatal "message" anywhere in your rails code. The "message" will go into respective log (development.log,...) - see also http://api.rubyonrails.com/classes/ActionView/Helpers/DebugHelper.html - run your code without service - look around rubyonrails.com for more debugging possibilities
On 11/6/06, Justin Johnson <justinjohnson at gmail.com> wrote:> I posted this to the discussion forum on rubyforge.org, but it appears that > it would have been better to post here. >As said by Jano Svitok, its mostly related to puts nature. Also, is not safe, on any webapp, use puts directly!!! Zed will agree (and he could get mad about this abuse of mongrel) ;-) Guess you should check WHY your rails application is eating your tags instead of hacking... I mean, "solving" your problem using puts, nothing good you will get from that. if you want debug information, try using logger or STDERR.puts which is redirected to service.log.> Does anyone have any advice on how to resolve the problem reported at > http://rubyforge.org/tracker/index.php?func=detail&aid=6284&group_id=1306&atid=5145 > ? > > Thanks, > Justin > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > >-- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
On 11/6/06, Luis Lavena <luislavena at gmail.com> wrote:> > On 11/6/06, Justin Johnson <justinjohnson at gmail.com> wrote: > > I posted this to the discussion forum on rubyforge.org, but it appears > that > > it would have been better to post here. > > > > As said by Jano Svitok, its mostly related to puts nature. > > Also, is not safe, on any webapp, use puts directly!!! Zed will agree > (and he could get mad about this abuse of mongrel) ;-) > > Guess you should check WHY your rails application is eating your tags > instead of hacking... I mean, "solving" your problem using puts, > nothing good you will get from that.Thank you, this has been helpful. I will get into the habit of using logger instead of puts. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061107/9bddab3a/attachment.html