From e8e8da5c85c105b7a4fec904f82c5e3c7fce507a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 19 Jan 2010 16:01:53 +0100 Subject: Logging thread should not die on logging errors. --- railties/lib/rails/subscriber.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'railties/lib') 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? -- cgit v1.2.3