Skip to content

Instantly share code, notes, and snippets.

@psahni
Created April 1, 2015 05:52
Show Gist options
  • Select an option

  • Save psahni/e8aa5ca09cfe96a88bf7 to your computer and use it in GitHub Desktop.

Select an option

Save psahni/e8aa5ca09cfe96a88bf7 to your computer and use it in GitHub Desktop.
Rails Production with logging

How to run application as service and managing logging in production

  • Install foreman gem to manage processes

    Procfile

    web: rails server

  • Type following command $ sudo foreman export --app app_name --user prashant upstart /etc/init $ ls /etc/init/app_name* $ ls /var/log/app_name/ In this way out app is on par with a core system service. We don’t have to dabble with PID files, system handles that. The OS will automatically reboot service if it crashes, rotate logs.

More info: http://stackoverflow.com/questions/12990842/how-to-use-foreman-to-export-to-upstart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment