user483040
user483040

Reputation:

Debugging Elixir phoenix.server

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.

Upvotes: 4

Views: 2516

Answers (2)

Marcos Costa Pinto
Marcos Costa Pinto

Reputation: 1946

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

Upvotes: 2

Jesse Shieh
Jesse Shieh

Reputation: 4850

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

Upvotes: 1

Related Questions