samuelkadolph / unicorn-rails

unicorn-rails is a simple gem that sets the default server for rack (and rails) to unicorn.
MIT License
127 stars 22 forks source link

Accessing Rails.logger under hooks #10

Closed scicco closed 10 years ago

scicco commented 10 years ago

When starting my application i got the following error:

ERROR -- : undefined method logger' for Unicorn::Rails:Module (NoMethodError) config/unicorn/development.rb:10:inblock in reload'

this is my config file:

require ::File.expand_path('../../environment', FILE) worker_processes Integer(ENV['WEB_CONCURRENCY'] || 2) timeout 30 preload_app true

before_fork do |server, worker|

the following is highly recomended for Rails + "preload_app true"

as there's no need for the master process to hold a connection

ActiveRecord::Base.establish_connection Rails.logger.info('Connected to ActiveRecord') end ...

How can i access the Rails.logger when using this gem?

Thank you in advance.

samuelkadolph commented 10 years ago

Fixed in 2.1.0