axelson
How do you disable logging in Ecto 3.0.7?
Since I’ve recently finished the main upgrade to Ecto 3.0
I’m now working on related updates. Since Ecto.LogEntry is soft deprecated in 3.0 (and will be fully deprecated in 3.1) I want to replace usage of it now. It seems that the way to go is to disable the built-in logging and build my own logging using the telemetry api:
- [Ecto.Repo] The
:loggersconfiguration is deprecated in favor of “Telemetry Events”
However, when I try to disable the built-in logging by setting my :loggers configuration to an empty list, the ecto logs are still printing out to the console when I run mix phx.server.
This is what my configuration looks like:
config :my_app, MyApp.Repo,
loggers: []
Environment:
- Elixir: 1.8.1
- Erlang: 21.2
- Ecto: 3.0.7
Edit:
After forcing a recompile of my repo I do see the following warning:
the :loggers configuration for MyApp.Repo is deprecated.
* To customize the log level, set log: :debug | :info | :warn | :error instead
* To disable logging, set log: false instead
* To hook into logging events, see the \"Telemetry Events\" section in Ecto.Repo docs
However, even adding config :my_app, MyApp.Repo, log: false I still cannot disable the built-in logging. Am I missing anything?
First Post!
josevalim
If log: false is not working, then that’s a bug. Please report it to the ecto_sql repo.
EDIT: although I just tried setting log: false and it worked in a local project using Ecto 3.0.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









