In rails I want to log some information in a different log file and not the standard development.log or production.log. I want to do this logging from a model class.
class DebugLog
def self.debug(message=nil)
return unless Rails.env.development? and message.present?
@logger ||= Logger.new(File.join(Rails.root, 'log', 'debug.log'))
@logger.debug(message)
end
end