Skip to content

Commit

Permalink
add back logging levels
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshull committed Jan 19, 2024
1 parent 6dd9d42 commit 016338b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/deps/logger.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ config :logster, :allowed_headers, ["referer"]
if config_env() == :prod do
# Do not print debug messages in production
config :logger,
level: :notice,
level: :info,
handle_sasl_reports: true,
backends: [:console]

config :logger, :console,
level: :notice,
level: :info,
format: "$dateT$time [$level]$levelpad node=$node $metadata$message\n",
metadata: [:request_id, :ip]
end
Expand Down
6 changes: 6 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,9 @@ config :recaptcha,
config :sentry,
dsn: System.get_env("SENTRY_DSN"),
environment_name: System.get_env("SENTRY_ENVIRONMENT")

if System.get_env("LOGGER_LEVEL") in ~w(emergency alert critical error warning notice info debug all none) &&
config_env() != :test do
config :logger, level: String.to_atom(System.get_env("LOGGER_LEVEL"))
config :logger, :console, level: String.to_atom(System.get_env("LOGGER_LEVEL"))
end

0 comments on commit 016338b

Please sign in to comment.