ecto / mute log for a given query

Viewed 25

Ecto logging customization is possible app-wide; but i was wondering if an option exists to mute logs only for specific queries

Having many batches occurring in the background with this kind of query; returning large logs :

Repo.insert_all(
  ModelName,
  dataset,
  on_conflict: :replace_all,
  conflict_target: [:col1, :col2]
)

Was looking to mute those specifically in order not to pollute the iex console

1 Answers
Repo.insert_all(
  ModelName,
  dataset,
  on_conflict: :replace_all,
  conflict_target: [:col1, :col2],
  log: false
)

That should work.

More info in the docs here.

Related