       Plug.Adapters.Cowboy.child_spec(scheme, endpoint, [], config)
 
     # Rewrite MFA for proper error reporting
-    mfa = {__MODULE__, :start_link, [scheme, endpoint, config, mfa]}
+    mfa = {__MODULE__, :start_link, [scheme, endpoint, mfa]}
     {ref, mfa, type, timeout, kind, modules}
   end
 

  @doc """
  Callback to start the Cowboy endpoint.
  """
  def start_link(scheme, endpoint, config, {m, f, [ref | _] = a}) do
    # nb on [ref | _] above; ref is used by Ranch to identify its listeners,
    # defaulting to plug.HTTP and plug.HTTPS and overridable by users.
    # See the following for more information:
    # https://github.com/elixir-lang/plug/blob/6ef08ce/lib/plug/adapters/cowboy.ex#L39-L47
    # https://github.com/elixir-lang/plug/blob/6ef08ce/lib/plug/adapters/cowboy.ex#L164-L166
    # https://github.com/ninenines/ranch/blob/236d0f8/src/ranch.erl#L88-L95
    case apply(m, f, a) do
      {:ok, pid} ->
        Logger.info info(scheme, endpoint, ref)

    end
  end

  defp info(scheme, endpoint, ref) do
    port = :ranch.get_port(ref)
    "Running #{inspect endpoint} with Cowboy using #{scheme} on port #{port}"
  end
end
