Hi I dont know much about logging in rails? Could anybody please explain how to do that in a live application? Or point me to any latest links which gives a detailed description of how to do this for different environments in rails? Why I am asking this is, I don''t know where to start. But have a vague idea about the levels info,debug, etc. But dont know how to apply that (Or use it) in my application which is in an initial stage.Please help Thanks in advance Tom -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 16 March 2010 09:03, Tom Mac <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi > I dont know much about logging in rails? Could anybody please > explain how to do that in a live application? Or point me to any latest > links which gives a detailed description of how to do this for different > environments in rails? Why I am asking this is, I don''t know where to > start. But have a vague idea about the levels info,debug, etc. But dont > know how to apply that (Or use it) in my application which is in an > initial stage.Please helpHave a look at the rails guide on debugging at http://guides.rubyonrails.org/. This has information on using the logger and other debugging techniques. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Also take a look at Ruby''s Logger documentation http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/ -- anl On Tue, Mar 16, 2010 at 10:22 AM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 16 March 2010 09:03, Tom Mac <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Hi > > I dont know much about logging in rails? Could anybody please > > explain how to do that in a live application? Or point me to any latest > > links which gives a detailed description of how to do this for different > > environments in rails? Why I am asking this is, I don''t know where to > > start. But have a vague idea about the levels info,debug, etc. But dont > > know how to apply that (Or use it) in my application which is in an > > initial stage.Please help > > Have a look at the rails guide on debugging at > http://guides.rubyonrails.org/. This has information on using the > logger and other debugging techniques. > > Colin > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Thanks for all reply. When googling I saw this http://toolmantim.com/thoughts/logging_rails_to_syslog_with_sysloglogger Since a beginner I am asking what will be the advantage if using above? And also I would like to know what are the latest happenings like this Thanks Tom -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 16 March 2010 10:44, Tom Mac <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi > Thanks for all reply. When googling I saw this > > http://toolmantim.com/thoughts/logging_rails_to_syslog_with_sysloglogger > > Since a beginner I am asking what will be the advantage if using > above? And also I would like to know what are the latest happenings like > thisWhen starting with something new (Rails in this case) I suggest starting with the built in tools, when you are familiar with those then you can start looking round at other stuff that may or may not provide further useful features. Colin -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Colin Thanks for replying back. One more thing I need to clarify is when to use the different levels for logging? For example say in controller we can write logger.info "some thing" or logger.warn "something" How can we know that we should chose this here say info or warn here? Is there any criteria for this? My question may be blunder please excuse. Could you please pont to a good example? Tom -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
If, in your application you are expecting value_a but it''s either nil or you have another value, that could be logger.error (if it''s critical to the continuation of the application) or if you can work around it but want to be notified about it to sort it out in the future it could be logger.warn, logger.info could be "I''m here #{value_a}" Anyway, it''s up to you to decide what is a warning and what is an error. I just googled this for you ........ http://www.faqs.org/docs/evms/loglevels.html On 16 March 2010 12:03, Tom Mac <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi Colin > > Thanks for replying back. One more thing I need to clarify is when > to use the different levels for logging? For example say in controller > we can write > logger.info "some thing" or logger.warn "something" > How can we know that we should chose this here say info or warn > here? Is there any criteria for this? My question may be blunder please > excuse. Could you please pont to a good example? > > Tom > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 100% naturally selected. 0% designed. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I''m always use debug in development because that''s why I use it for, debug my app, better yet, change the default logger of Rails in your environment to point to STDERR and you''ll see your debug messages in the server shell via guides.rubyonrails.org ActiveRecord::Base.logger = Logger.new(STDERR) -- anl On Tue, Mar 16, 2010 at 12:19 PM, Anthony Gardner <antsmailinglist-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If, in your application you are expecting value_a but it''s either nil or > you have another value, that could be logger.error (if it''s critical to the > continuation of the application) or if you can work around it but want to be > notified about it to sort it out in the future it could be logger.warn, > > logger.info could be "I''m here #{value_a}" > > Anyway, it''s up to you to decide what is a warning and what is an error. > > I just googled this for you ........ > > http://www.faqs.org/docs/evms/loglevels.html > > > On 16 March 2010 12:03, Tom Mac <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> Hi Colin >> >> Thanks for replying back. One more thing I need to clarify is when >> to use the different levels for logging? For example say in controller >> we can write >> logger.info "some thing" or logger.warn "something" >> How can we know that we should chose this here say info or warn >> here? Is there any criteria for this? My question may be blunder please >> excuse. Could you please pont to a good example? >> >> Tom >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > > -- > 100% naturally selected. 0% designed. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.