idi527
![]()
I’ve added
config :logger,
compile_time_purge_matching: [
[application: :phoenix, level_lower_than: :warn],
[application: :plug, level_lower_than: :warn]
]
to my config (dev.exs) and recompiled phoenix and plug with mix deps.compile plug phoenix --force (using dev env) but the info level logs still show up (in dev env).
The global logger log level is set to :debug.
What have I done wrong?
elixir -v
Erlang/OTP 22 [erts-10.4.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]
Elixir 1.9.0 (compiled with Erlang/OTP 22)
Not specifying level_lower_than seems to work as
config :logger,
compile_time_purge_matching: [
[application: :phoenix],
[application: :plug]
]
removes all logs as seen from the compilation warnings
==> plug
Compiling 1 file (.erl)
Compiling 39 files (.ex)
warning: variable "log" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/plug/session/cookie.ex:131: Plug.Session.COOKIE.decode/3
warning: variable "log" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/plug/session/cookie.ex:158: Plug.Session.COOKIE.decode/3
warning: variable "level" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/plug/logger.ex:26: Plug.Logger.call/2
warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
lib/plug/conn/wrapper_error.ex:23
Generated plug app
==> phoenix
Compiling 67 files (.ex)
warning: variable "level" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/phoenix/logger.ex:107: Phoenix.Logger.phoenix_endpoint_start/4
warning: variable "level" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/phoenix/logger.ex:116: Phoenix.Logger.phoenix_endpoint_stop/4
warning: variable "level" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/phoenix/logger.ex:132: Phoenix.Logger.phoenix_error_rendered/4
warning: variable "level" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/phoenix/logger.ex:154: Phoenix.Logger.phoenix_router_dispatch_start/4
warning: variable "level" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/phoenix/logger.ex:182: Phoenix.Logger.phoenix_socket_connected/4
warning: variable "level" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/phoenix/logger.ex:257: Phoenix.Logger.channel_log/3
Generated phoenix app
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
idi527
Seems like since
levelis settable for phoenix logger at runtime it’s not purgeable with this option.My goal was to remove
GET / ... Sent in ...logs in:infolevel and it was possible by setting:logoption to:debugforPlug.Logger.idi527
Actually that didn’t work, the logs still appear but now for
phoenixsockets and controllers.even though I have
set in
app_web.exandset in
endpoint.ex.Phoenix version 1.4.9
Seems like the log level option for
"phoenix_error_rendered/4"comes from a module attribute, so my changes to config are unlike to change anything … Do I need to recompile the:phoenixdependency? Seems like I need to setlog: falsein for endpoint’srender_errorsoption. I wonder if I’m missing some obvious way to turn off all logs in phoenix. Or rather make them at:debuglevel.Very strange, the function that logs
"phoenix_error_rendered/4"doesn’t receive the log level (according to the gist below), but that would mean that it should use:debuglevel but uses:infoinstead as I see it logged.https://gist.github.com/syfgkjasdkn/668072702caeb965bae3c8e895abddb5
Trace for socket connect log:
Log level is
:info, even though it’s set tofalsein the endpoint …Tried recompiling from scratch, still
Would need to find an easier way to do the logging, since in phoenix logs are neither purgeable at compile-time, nor settable at runtime … unless I’m holding it wrong.
socket_connectedgets logged. Giving up for todaygrigorius
I encountered the same issue with a plug app - can not purge Plug.Logger info logs even after running mix deps.compile --force
Still see this:
16:31:58.961 [info] Sent 200 in 1mConfig:
Version: