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

Errors and Exceptions should not be silently piped to an unreachable log file on Heroku #82

Closed
johnmcdowall opened this issue Feb 10, 2015 · 5 comments

Comments

@johnmcdowall
Copy link

In app.rb the output from executing the Ember-CLI build is silently piped to a log file:

https://github.com/rwz/ember-cli-rails/blob/master/lib/ember-cli/app.rb#L18

This is bad on Heroku, because it looks like the build succeeds and causes a downstream exception to be raised in Sprockets because the files it was told to expect don't exist because of the build failure. In general this is a bad thing™ to do. It is also a violation of the 12factor application principles with regard to logging:

It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will view this stream in the foreground of their terminal to observe the app’s behaviour.

There are two ways I see to addressing this:

  1. Check for a specific EMBER_CLI_RAILS_VERBOSE environment variable that disables suppression of STDOUT.
  2. Check for existence of BUILDPACK_URL environment variable to indicate we are running on Heroku and shouldn't suppress STDOUT.

Happy to make PRs with the relevant changes if open to them.

@rondale-sc
Copy link
Collaborator

@johnmcdowall I think instead it'd be better to just remove the silence altogether. compile is only run in production (on rake assets:precompile typically) and having a little extra noise there isn't a problem. It seems as if this was a vestigial piece of code when we thought compile was going to be producing noise considerably more often.

[EDIT] if you'd like to do a PR just let me know, otherwise I'll work on it sometime this weekend.

@rondale-sc
Copy link
Collaborator

@johnmcdowall Started working on this. Turns out we did this to avoid this gnarly output (EDIT: in test):

We are likely going to make silencing this stream optional. Will post more when I know.

@rwz
Copy link
Collaborator

rwz commented Feb 13, 2015

screen shot 2015-02-13 at 3 35 13 pm

So, it now doesn't silence the build output by default when

  • it's not production (or Heroku build)
  • there is an EMBER_CLI_RAILS_VERBOSE env variable

@rondale-sc
Copy link
Collaborator

@johnmcdowall Thanks 🍻

@johnmcdowall
Copy link
Author

@rondale-sc Great work, thanks! 👍

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

No branches or pull requests

3 participants