diff --git a/config/config.exs b/config/config.exs index 8deb32d771..42ca7fa18f 100644 --- a/config/config.exs +++ b/config/config.exs @@ -10,7 +10,9 @@ import Config config :lightning, ecto_repos: [Lightning.Repo] -config :lightning, Lightning.Repo, types: Lightning.PostgrexTypes +config :lightning, Lightning.Repo, + types: Lightning.PostgrexTypes, + log: :debug config :hammer, backend: diff --git a/config/runtime.exs b/config/runtime.exs index 3a993139d4..f39fe9e418 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -236,7 +236,16 @@ config :lightning, LightningWeb.Endpoint, ] if log_level = System.get_env("LOG_LEVEL") do - config :logger, level: log_level |> String.to_atom() + allowed_log_levels = + ~w[emergency alert critical error warning warn notice info debug] + + if log_level in allowed_log_levels do + config :logger, level: log_level |> String.to_atom() + else + raise """ + Invalid LOG_LEVEL, must be on of #{allowed_log_levels |> Enum.join(", ")} + """ + end end if config_env() == :prod do