How to prevent logging Rails stack trace

Viewed 2111

I'm trying to reduce the amount of noise in my logs and would like to disable Rails from logging the stack trace during errors.

Since I am using an error reporting service (Honeybadger.io) I don't need to see the stack trace in the logs as it's already available in the exception report from the error handling service.

3 Answers

The default Rails middleware DebugExceptions is what logs the errors.

You can remove it with config.middleware.delete(ActionDispatch::DebugExceptions) in your config/environment.rb or config/environments/production.rb

Related