Disable Elixir Ecto Debug output

前端 未结 5 1063
别那么骄傲
别那么骄傲 2021-02-12 14:23

Whatever in iex> or using mix run -e \"My.code\" when I run the mix project using ecto, the Ecto\'s Debugging Mechanism display a bunch of SQLs like

5条回答
  •  滥情空心
    2021-02-12 15:24

    Your logging level is configured in your config/#{env}.exs files. If you look into config/prod.exs it most likely already has that level set to :info:

    config :logger, level: :info
    

    So if you run the app with MIX_ENV=prod iex -S mix you won't get the debug output. This means that when you build a release with something like MIX_ENV=prod mix release the resulting build won't be producing this output. Alternatively you may set level: :info or :warn for whatever environment you want by changing the appropriate config/#{env}.exs.

提交回复
热议问题