Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Logger.put_module_level does not silence preloads

Open
#602 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
elixir, postgresql
Domain
databases

Research direction

Start by tracing how query logging handles preload-generated queries and how Logger.put_module_level and Logger.put_process_level are applied. Review the stacktrace information described in the issue and compare it with Logger.get_module_level and Logger.get_process_level behavior. Done means an agreed approach is implemented and preload queries honor the intended logging level, with regression coverage.

Written by the indexing model from the issue text.

Description

Kind:Bug
Elixir version

1.17.0-dev

Database and Version

PostgreSQL 14

Ecto Versions

Ecto 3.11

Database Adapter and Versions (postgrex, myxql, etc)

postgrex 0.17.5

Current behavior

I have a job that runs some queries that I'd like to exclude from logging in development. I'm using Logger.put_module_level, which works just fine, except for queries caused by preloads. I also tried setting Logger.put_process_level, but that also only works for the initial queries and not the preloads.

Expected behavior

As the logged information from the stacktrace includes the originating module, it would be nice if it used this information to lookup a level using Logger.get_module_level or maybe even Logger.get_process_level using the callers?

Maybe there are some other ideas on how to achieve this.

I'd be happy to work on a PR for this with some feedback on what the correct approach could be.

Dominant language
Elixir
Stars
657
Forks
345
Avg merge
1h 59m
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elixir-ecto/ecto_sql

All issues in elixir-ecto/ecto_sql

Similar issues

More Elixir issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.