Method: Unicorn::Configurator#logger

Defined in:
lib/unicorn/configurator.rb

#logger(obj) ⇒ Object

sets object to the obj Logger-like object. The new Logger-like object must respond to the following methods:

  • debug

  • info

  • warn

  • error

  • fatal

The default Logger will log its output to the path specified by stderr_path. If you’re running Unicorn daemonized, then you must specify a path to prevent error messages from going to /dev/null.



143
144
145
146
147
148
149
150
# File 'lib/unicorn/configurator.rb', line 143

def logger(obj)
  %w(debug info warn error fatal).each do |m|
    obj.respond_to?(m) and next
    raise ArgumentError, "logger=#{obj} does not respond to method=#{m}"
  end

  set[:logger] = obj
end