Skip to content

Commit

Permalink
Export env vars logging Erlang crash dumps (#3649)
Browse files Browse the repository at this point in the history
Uncommenting these exports will output Erlang crash dumps to stderr,
rather than to an erl_crash.dump file.

Many folks run into issues trying to debug an Elixir application that
is crashing and the logs output this:

    Crash dump is being written to: erl_crash.dump...done

Because our machines are ephemeral, this is cleared immediately and
there's no way get the file without doing shenanigans with your
Dockerfile. Now you have minimal shenanigans to get the info via
`fly logs`.
  • Loading branch information
matthewlehner committed Jun 18, 2024
1 parent d618f10 commit dd3c03f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scanner/phoenix.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ export ECTO_IPV6="true"
export DNS_CLUSTER_QUERY="${FLY_APP_NAME}.internal"
export RELEASE_DISTRIBUTION="name"
export RELEASE_NODE="${FLY_APP_NAME}-${FLY_IMAGE_REF##*-}@${FLY_PRIVATE_IP}"
# Uncomment to send crash dumps to stderr
# This can be useful for debugging, but may log sensitive information
# export ERL_CRASH_DUMP=/dev/stderr
# export ERL_CRASH_DUMP_BYTES=4096
`
_, err := os.Stat(envEExPath)
if os.IsNotExist(err) {
Expand Down

0 comments on commit dd3c03f

Please sign in to comment.