diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-19 16:01:53 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-19 16:13:27 +0100 |
commit | e8e8da5c85c105b7a4fec904f82c5e3c7fce507a (patch) | |
tree | 5920f0dd3da8d99e1183b80b0c682f6a6a7f76ed /railties/lib | |
parent | ec63fdcff35d9ee195e11043ba3219b1e341a3f2 (diff) | |
download | rails-e8e8da5c85c105b7a4fec904f82c5e3c7fce507a.tar.gz rails-e8e8da5c85c105b7a4fec904f82c5e3c7fce507a.tar.bz2 rails-e8e8da5c85c105b7a4fec904f82c5e3c7fce507a.zip |
Logging thread should not die on logging errors.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/subscriber.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/subscriber.rb b/railties/lib/rails/subscriber.rb index 2674bf003e..9965786d86 100644 --- a/railties/lib/rails/subscriber.rb +++ b/railties/lib/rails/subscriber.rb @@ -63,7 +63,11 @@ module Rails subscriber = subscribers[namespace.to_sym] if subscriber.respond_to?(name) && subscriber.logger - subscriber.send(name, ActiveSupport::Notifications::Event.new(*args)) + begin + subscriber.send(name, ActiveSupport::Notifications::Event.new(*args)) + rescue Exception => e + Rails.logger.error "Could not log #{args[0].inspect} event. #{e.class}: #{e.message}" + end end if args[0] == "action_dispatch.after_dispatch" && !subscribers.empty? |