4

What I am looking for is some ideas on how to debug mix phoenix.server

When I run the command there is no output and it hangs (doesn't finish and show the cmd prompt). I've tried:

IEx -S mix phoenix.server

this opens up the elixir session but at that point I'm unsure what to do next. I was hoping to see something verbose that showed me where specifically the server start was stopping. I tried:

mix phoenix.server --verbose 

and that didn't work, of course. At this moment I'm struggling to figure out what the right approach to this is.

Afshin Moazami
  • 2,092
  • 5
  • 33
  • 55
jaydel
  • 14,389
  • 14
  • 62
  • 98
  • Can you give us more details at which moment this happened ? Is it a new app ? If not, can you give us the potential modifications to the code that might have made this happen ? Thanks – BachirC Jun 14 '17 at 23:11

2 Answers2

2

In your code you need to require the IEx module and place an IEx.pry where you want to debug:

defmodule MyModule do
    require IEx

    def my_function do
        IEx.pry
    end
end

then run your phoenix server in an IEx context:

iex -S mix phx.server
ijt
  • 3,505
  • 1
  • 29
  • 40
Marcos Costa Pinto
  • 1,676
  • 3
  • 12
  • 14
1

Try modifying your dev.exs file and set your logger level to debug.

Jesse Shieh
  • 4,660
  • 5
  • 34
  • 49