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