How do I use the regular rails logger in a rails app in a class that is does not inherit from active record? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Do you want to log from a controller?  If so, something like this in
application.rb is handy:
def log(message)
  logger.info "Any_prefix_you_want_to_grep: #{message.to_s}"
end
If you want to log from somewhere that''s not inheriting any part of
the rails stack, I''ll let someone else answer...
On Feb 7, 2:25 pm, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> How do I use the regular rails logger in a rails app in a class that
> is does not inherit from active record?
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Jeffrey L. Taylor
2009-Feb-07  21:59 UTC
Re: Use rails logger in a class without active record
Quoting Me <chabgood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > How do I use the regular rails logger in a rails app in a class that > is does not inherit from active record?RAILS_DEFAULT_LOGGER.debug "Debug message" HTH, Jeffrey --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---