Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
# Use a different logger for distributed setups ObjectSpace.each_object(Mongrel::HttpServer) { |i| @port = i.port } rescue nil # Need to be able to run this code during migrations or console if @port and @port.to_i > 0 config.logger = Logger.new File.expand_path(RAILS_ROOT+"/log/#{ENV['RAILS_ENV']}.#{@port}.log"), 5, 100.megabytes else puts "Port could not be introspected; we must not be running Mongrel in this instance." end
From the Design Piracy series on my blog: