collectiveidea/delayed_job — pull request #646 by xrx (2014-04-05 14:44:21+00:00)
Title: * Modified the Worker#say method to be able to handle other loggers as "Syslog"

Currently is not possible to the [log4r](https://rubygems.org/gems/log4r) gem as a worker's logger as it's uses the ```logger.add``` method [for other purposes](https://github.com/colbygk/log4r/blob/master/lib/log4r/logger.rb#L119)

This happened when setting in a initializer the logger to use syslog like this:

Delayed::Worker.logger = Rails.logger

And when running ```delayed_job``` the following problem arised:

bundle exec rake jobs:work
[Worker(host:xrx.local pid:12424)] Starting job worker
rake aborted!
Expected kind of Outputter, got NilClass
/Users/xrx/.rvm/gems/ruby-1.9.3-p545/gems/log4r-1.1.10/lib/log4r/logger.rb:120:in `each'
/Users/xrx/.rvm/gems/ruby-1.9.3-p545/gems/log4r-1.1.10/lib/log4r/logger.rb:120:in `add'
/Users/xrx/.rvm/gems/ruby-1.9.3-p545/gems/delayed_job-4.0.0/lib/delayed/worker.rb:248:in `say'
/Users/xrx/.rvm/gems/ruby-1.9.3-p545/gems/delayed_job-4.0.0/lib/delayed/worker.rb:147:in `start'
/Users/xrx/.rvm/gems/ruby-1.9.3-p545/gems/delayed_job-4.0.0/lib/delayed/tasks.rb:9:in `block (2 levels) in '
Tasks: TOP => jobs:work
(See full trace by running task with --trace)

The idea of the patch is to log through the mapped log levels. e.g. ```logger.info```, ```logger.debug``` and so on.

If you need more information about the problem let me know.