# Mongrel cluster identification

**URL:** <https://www.ruby-forum.com/t/mongrel-cluster-identification/159052>\
**Category:** Deployment\
**Created:** [January 30, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-identification/159052 "2009-01-30T20:50:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![balla123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/df788c/32.png) [@balla123](https://www.ruby-forum.com/u/balla123)\
**Post date:** [January 30, 2009, 8:50pm UTC](https://www.ruby-forum.com/t/mongrel-cluster-identification/159052/1 "2009-01-30T20:50:05Z")

</div>

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?
