return i18n.getJsDictionnary(rubyLocale);
}
+ public void logError(String message) {
+ LoggerFactory.getLogger(getClass()).error(message);
+ }
+
public ReviewsNotificationManager getReviewsNotificationManager() {
return getContainer().getComponentByType(ReviewsNotificationManager.class);
}
end
def render_error(error)
- logger.error("Fail to render: #{request.url}", error)
+ # Ruby on Rails has a single logger "rails", so it's not possible to distinguish profiling logs
+ # from error logs. For this reason a standard SLF4J logger is used instead of logger.error().
+ java_facade.logError("Fail to render: #{request.url}\n#{Api::Utils.exception_message(error)}")
render :file => "#{Rails.public_path}/500.html", :status => 500
end
params = options[:params]||[]
Java::OrgSonarServerUi::JRubyFacade.getInstance().getMessage(I18n.locale, key, default, params.to_java)
end
+
+ def self.exception_message(exception)
+ result = (exception.respond_to?(:message) ? "#{exception.message}\n" : "#{message}\n")
+ if exception.respond_to? :backtrace
+ result << "\t" + exception.backtrace.join("\n\t") + "\n"
+ end
+ result
+ end
end