Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubled errors output #1664

Closed
kvokka opened this issue Nov 10, 2020 · 0 comments · Fixed by #1665
Closed

Doubled errors output #1664

kvokka opened this issue Nov 10, 2020 · 0 comments · Fixed by #1665

Comments

@kvokka
Copy link

kvokka commented Nov 10, 2020

Given modular app, with some external logger

class ApplicationController < Sinatra::Base
  enable :logging

  set(:logger) { SomeAwesomeModule.logger }
  configure do
    use ::Rack::CommonLogger, settings.logger
  end

  errors do
    logger.error env['sinatra.error'].message
  end
end

and this will raise output all error in dev & prod environments twice- first time with the logger and the second time from dump_errors extension.

class ApplicationController < Sinatra::Base
  disable :dump_errors

helps to fix it. Maybe it is a feature, which i just did not get. Anyway, i feel like at least issue should be created and/or readme updated. or maybe disable :dump_errors with custom logger.

Anyway, hope this the situation a bit more clear and maybe save someone's else day.

dentarg added a commit to dentarg/sinatra that referenced this issue Nov 10, 2020
jkowens pushed a commit to jkowens/sinatra that referenced this issue Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant