Forum: Rails deployment Mongrel cluster identification

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ball B. (Guest)
on 2009-01-30 21: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

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

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 "#{} is performing expensive query"

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