log fatal errors that we catch

In case we rescue from a fatal error, we want the error and the backtrace to
the error logged, so we can debug later on. This change injects the configured
logger from the rails app to the grape API and logs error as well as backtrace
in a rails-like fashion.
This commit is contained in:
Felix Gilcher 2013-02-01 09:42:02 +00:00
parent 2a669fc899
commit c72910a8bf
2 changed files with 11 additions and 1 deletions

View file

@ -8,6 +8,7 @@ Gitlab::Application.routes.draw do
# API
require 'api'
Gitlab::API.logger Rails.logger
mount Gitlab::API => '/api'
constraint = lambda { |request| request.env["warden"].authenticate? and request.env['warden'].user.admin? }