Forum: Rails deployment Mongrel cluster identification

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1bb8d2f105bfc1095bad2c513681737a?d=identicon&s=25 Ball Balla (balla123)
on 2009-01-30 20:50
I have some singleton class that I want to make sure is only getting
instantiated once. I have something like this:

class Someclass
  include Singleton

  def initialize
    @something = nil
  end

  def something
    return @something unless @something.blank?
    logger.warn "Performing expensive query"
    @something = 'Some expense query'
  end
end

In development it will always output the log message because the classes
are reloaded every time. I want to confirm that this is not the case in
production. I have a mongrel cluster so I should expect at max amount of
log messages to be the size of my cluster. Is there anyway to output the
mongrels instance id in the log message so I know for sure that there is
only 1 output message per mongrel.

Something like logger.warn "#{MONGREL.id} is performing expensive query"

Is there a way I can do this?
This topic is locked and can not be replied to.