Bret H
2008-Jun-30 07:00 UTC
Controller#index is getting called immediately after every single other call
This is a very odd problem, it''s been happening, I think, ever since I patched to Rails 2.1.0 Every time a public method gets called in my Controller, the index method gets called immediately afterwards. It''s not in my code, and my best guess after testing it on two pretty different machines is, it''s not my browser settings either. My cookies and sessions seem to be working fine, DB isn''t behaving oddly. In absence of a direct answer, I''m wondering if someone can tell me how to get Rails Logger (or equivalent) to spit out a complete stacktrace. I''m sure if I could just see where the heck that call is coming from, I could solve the rest of it. Thanks very much, Bret --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Guillaume Petit
2008-Jun-30 09:48 UTC
Re: Controller#index is getting called immediately after every single other call
Bret H wrote:> This is a very odd problem, it''s been happening, I think, ever since I > patched to Rails 2.1.0 > > > In absence of a direct answer, I''m wondering if someone can tell me > how to get Rails Logger (or equivalent) to spit out a complete > stacktrace. I''m sure if I could just see where the heck that call is > coming from, I could solve the rest of it. > > Thanks very much, > > > BretYou should find your logs at /log in your rails app folder. There should be 3 files, one for each environment mode (test / dev / prod), they are automatically filled up with request information. Guillaume Petit -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bret H
2008-Jun-30 13:04 UTC
Re: Controller#index is getting called immediately after every single other call
Hi, thanks for the suggestion.. my experience so far is that information only gets written to the log when I write it explicitly with a call like Logger.debug("sometext") I''m not sure how I could capture the information I need given this limitation. Any ideas?> You should find your logs at /log in your rails app folder. There should > be 3 files, one for each environment mode (test / dev / prod), they are > automatically filled up with request information. > > Guillaume Petit > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Guillaume Petit
2008-Jun-30 16:21 UTC
Re: Controller#index is getting called immediately after every single other call
Well you got it right :) Every controller in rails has a logger *automatically* instanciated for them. Simply use the logger.info("information to log"), (or .debug, .warn, etc ...) like you used to in other language to log more information. It''s a lowercase "l" Since we are in logging, try to call the method .inspect on any object you wish to look at, that will produce a nice string with your object information, very handy when it comes to logging :) I don''t know much in logging with rails, but so far, that was more than enough :) Guillaume Petit -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bret H
2008-Jul-01 06:37 UTC
Re: Controller#index is getting called immediately after every single other call
Ah, well I solved my problem. The method I needed is Kernel.caller(start=1).. returns a series of strings roughly approximating a stacktrace starting with the scope in which caller is called. Thanks for taking the time, though, Guillaume, Bret --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---