From 5f478f5a9a58f72c0a844258b8ee614bf24ea9f7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 17 Jun 2011 08:54:37 +0000 Subject: error logging is more consistent Backtraces are now formatted properly (with timestamps) and exceptions will be logged more consistently and similar to Logger defaults: "#{exc.message} (#{e.class})" backtrace.each { |line| ... } This may break some existing monitoring scripts, but errors will be more standardized and easier to check moving forward. --- lib/unicorn.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/unicorn.rb') diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 9349e49..9a5eb6f 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -77,6 +77,11 @@ module Unicorn Unicorn::SocketHelper.sock_name(io) end end + + def self.log_error(logger, message, exc) + logger.error "#{message}: #{exc.message} (#{exc.class})" + exc.backtrace.each { |line| logger.error(line) } + end # :startdoc: end # :enddoc: -- cgit v1.2.3-24-ge0c7