How do I use the regular rails logger in a rails app in a class that
is does not inherit from active record?
Quoting Me [email protected]:
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
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…