Logger.put_module_level does not silence preloads
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
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
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from elixir-ecto/ecto_sql
-
Kind:Enhancement Note:Discussion
Difficulty 5/5 Over a week Newbie friendliness 30/100
elixir-ecto/ecto_sql#666 · 1 comment ·
-
Kind:Enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
elixir-ecto/ecto_sql#637 · 3 reactions ·
All issues in elixir-ecto/ecto_sql
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
phoenixframework/phoenix#6847 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
moderation
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
beyond-all-reason/teiserver#1584 · 1 comment ·