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

Running Tasks, Getting Logs #49

Open
kmarsh opened this issue Feb 23, 2017 · 1 comment
Open

Running Tasks, Getting Logs #49

kmarsh opened this issue Feb 23, 2017 · 1 comment

Comments

@kmarsh
Copy link

kmarsh commented Feb 23, 2017

I was able to get gatling setup with little fuss (which is sweet!) but being new to Erlang, Elxir, and Phoenix I'm at a little bit of a loss for how to perform some administrative tasks on the server.

I think it'd be useful for people like me to know the how to run the Phoenix equivalents of the Rails world's:

  • tail -f log/production.log
  • rails console
  • rails runner "Model.long_running_command"

I'm digging around and will be happy to submit a PR to the docs once I figure this out, but some best practice guidance would be appreciated!

@kmarsh
Copy link
Author

kmarsh commented Apr 9, 2017

Figured out the console and logs bit:

Console

sudo service [app_name] remote_console

Logs

tail -f deployments/[app_name]/var/log/*

I'm still struggling with a runner equivalent. sudo service [app_name] has a few promising-looking options: escript, rpc, eval, and command. I tried a ton of variations with these but couldn't get anything to work (e.g., command throws "shift: can't shift that many" errors for anything I throw at it). Are these supposed to be given Erlang code, not Elixir code?

            echo "escript <file>                 # execute an escript"
            echo "rpc <mod> <fun> [<args..>]     # execute an RPC call using the given MFA"
            echo "rpcterms <mod> <fun> [<expr>]  # execute an RPC call using the given Erlang expression for args"
            echo "eval <expr>                    # execute the given Erlang expression on the running node"
            echo "command <mod> <fun> [<args..>] # execute the given MFA"

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

1 participant