Hi all, I upgraded my app from Phoenix 1.3 to 1.5 and suddenly there was a lot of PROGRESS_REPORT and CRASH_REPORT pumping up in my production iex console. I wonder what caused it and how can I make it log to a file rather then in the iex console?
I started the server like this
MIX_ENV=prod PORT=4000 iex -S mix phx.server
A progress report looks like the following:
=PROGRESS REPORT==== 24-May-2020::17:10:47 ===
supervisor: {<0.387.0>,'Elixir.Postgrex.TypeSupervisor'}
started: [{pid,<0.388.0>},
{id,'Elixir.Postgrex.TypeManager'},
{mfargs,
{'Elixir.Registry',start_link,
[[{keys,unique},
{name,'Elixir.Postgrex.TypeManager'}]]}},
{restart_type,permanent},
{shutdown,infinity},
{child_type,supervisor}]
And a crash report looks like this:
=CRASH REPORT==== 24-May-2020::12:51:41 ===
crasher:
initial call: cowboy_stream_h:request_process/3
pid: <0.8477.0>
registered_name: []
exception exit: {{{#{'__exception__' => true,
'__struct__' => 'Elixir.Phoenix.Router.NoRouteError',
conn =>
#{'__struct__' => 'Elixir.Plug.Conn',
adapter =>
{'Elixir.Plug.Cowboy.Conn',
#{bindings => #{},body_length => 0,
cert => undefined,has_body => false,
headers =>
#{<<"accept">> => <<"*/*">>,
<<"accept-encoding">> =>
<<"gzip,deflate">>,
<<"accept-language">> =>
<<"en-US, en; q=0.9, *; q=0.5">>,
<<"connection">> =>
<<"upgrade">>,
<<"host">> =>
<<"mydomain.com">>,
<<"user-agent">> =>
<<"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36">>,
<<"x-forwarded-for">> =>
<<"167.99.212.214">>,
<<"x-real-ip">> =>
<<"167.99.212.214">>},
host => <<"mydomain.com">>,
host_info => undefined,
method => <<"GET">>,
path => <<"/sitemap.xml">>,
path_info => undefined,
peer =>
{{0,0,0,0,0,65535,32512,1},58760},
pid => <0.8476.0>,port => 80,
qs => <<>>,
ref =>
'Elixir.MyAppWeb.Endpoint.HTTP',
scheme => <<"http">>,
sock =>
{{0,0,0,0,0,65535,32512,1},4003},
streamid => 1,version => 'HTTP/1.0'}},
assigns => #{},
before_send =>
[#Fun<Elixir.Logster.Plugs.Logger.0.69896351>],
body_params => #{},
cookies =>
#{'__struct__' =>
'Elixir.Plug.Conn.Unfetched',
aspect => cookies},
halted => false,host => <<"mydomain.com">>,
It seems like a router error to me.
I have already configged file backend for logger in production.
config :logger, backends: [{LoggerFileBackend, :info}, {LoggerFileBackend, :error}]
config :logger, :info,
path: "/var/log/my_app/info.log",
format: "$date $time $metadata[$level] $message\n",
level: :info
config :logger, :error,
path: "/var/log/my_app/error.log",
format: "$date $time $metadata[$level] $message\n",
level: :error