Use Path.absname so that log paths are stable during reload

Fixes #628

The Phoenix.CodeReloader causes the file loggers to restart and reload
their config, but when they reload, the current working directory has
shifted from the project root to the OTP app root, so it produces log
files under each OTP app (`apps/APP_NAME/logs`).  We don't want this, so
compute the absolute path in the config files, so that the loaded
`Application` environment has an absolute path in it that can't shift
when the working directory changes.
pull/630/head
Luke Imhoff 6 years ago
parent 867ed7235e
commit 9a8cdc4031
  1. 2
      apps/block_scout_web/config/dev.exs
  2. 2
      apps/block_scout_web/config/prod.exs
  3. 2
      apps/block_scout_web/config/test.exs
  4. 2
      apps/ethereum_jsonrpc/config/dev.exs
  5. 2
      apps/ethereum_jsonrpc/config/prod.exs
  6. 2
      apps/ethereum_jsonrpc/config/test.exs
  7. 2
      apps/explorer/config/dev.exs
  8. 2
      apps/explorer/config/prod.exs
  9. 2
      apps/explorer/config/test.exs
  10. 2
      apps/indexer/config/dev.exs
  11. 2
      apps/indexer/config/prod.exs
  12. 2
      apps/indexer/config/test.exs
  13. 4
      config/dev.exs
  14. 4
      config/prod.exs
  15. 4
      config/test.exs

@ -50,7 +50,7 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
config :logger, :block_scout_web, config :logger, :block_scout_web,
level: :debug, level: :debug,
path: "logs/dev/block_scout_web.log" path: Path.absname("logs/dev/block_scout_web.log")
# Set a higher stacktrace during development. Avoid configuring such # Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive. # in production as building large stacktraces may be expensive.

@ -26,4 +26,4 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
config :logger, :block_scout_web, config :logger, :block_scout_web,
level: :info, level: :info,
path: "logs/prod/block_scout_web.log" path: Path.absname("logs/prod/block_scout_web.log")

@ -11,7 +11,7 @@ config :block_scout_web, BlockScoutWeb.Endpoint,
config :logger, :block_scout_web, config :logger, :block_scout_web,
level: :warn, level: :warn,
path: "logs/test/block_scout_web.log" path: Path.absname("logs/test/block_scout_web.log")
# Configure wallaby # Configure wallaby
config :wallaby, screenshot_on_failure: true config :wallaby, screenshot_on_failure: true

@ -2,4 +2,4 @@ use Mix.Config
config :logger, :ethereum_jsonrpc, config :logger, :ethereum_jsonrpc,
level: :debug, level: :debug,
path: "logs/dev/ethereum_jsonrpc.log" path: Path.absname("logs/dev/ethereum_jsonrpc.log")

@ -2,4 +2,4 @@ use Mix.Config
config :logger, :ethereum_jsonrpc, config :logger, :ethereum_jsonrpc,
level: :info, level: :info,
path: "logs/prod/ethereum_jsonrpc.log" path: Path.absname("logs/prod/ethereum_jsonrpc.log")

@ -2,4 +2,4 @@ use Mix.Config
config :logger, :ethereum_jsonrpc, config :logger, :ethereum_jsonrpc,
level: :warn, level: :warn,
path: "logs/test/ethereum_jsonrpc.log" path: Path.absname("logs/test/ethereum_jsonrpc.log")

@ -11,7 +11,7 @@ config :explorer, Explorer.Repo,
config :logger, :explorer, config :logger, :explorer,
level: :debug, level: :debug,
path: "logs/dev/explorer.log" path: Path.absname("logs/dev/explorer.log")
import_config "dev.secret.exs" import_config "dev.secret.exs"

@ -11,7 +11,7 @@ config :explorer, Explorer.Repo,
config :logger, :explorer, config :logger, :explorer,
level: :info, level: :info,
path: "logs/prod/explorer.log" path: Path.absname("logs/prod/explorer.log")
variant = variant =
if is_nil(System.get_env("ETHEREUM_JSONRPC_VARIANT")) do if is_nil(System.get_env("ETHEREUM_JSONRPC_VARIANT")) do

@ -19,7 +19,7 @@ config :explorer, Explorer.Market.History.Cataloger, enabled: false
config :logger, :explorer, config :logger, :explorer,
level: :warn, level: :warn,
path: "logs/test/explorer.log" path: Path.absname("logs/test/explorer.log")
if File.exists?(file = "test.secret.exs") do if File.exists?(file = "test.secret.exs") do
import_config file import_config file

@ -2,7 +2,7 @@ use Mix.Config
config :logger, :indexer, config :logger, :indexer,
level: :debug, level: :debug,
path: "logs/dev/indexer.log" path: Path.absname("logs/dev/indexer.log")
variant = variant =
if is_nil(System.get_env("ETHEREUM_JSONRPC_VARIANT")) do if is_nil(System.get_env("ETHEREUM_JSONRPC_VARIANT")) do

@ -2,7 +2,7 @@ use Mix.Config
config :logger, :indexer, config :logger, :indexer,
level: :info, level: :info,
path: "logs/prod/indexer.log" path: Path.absname("logs/prod/indexer.log")
variant = variant =
if is_nil(System.get_env("ETHEREUM_JSONRPC_VARIANT")) do if is_nil(System.get_env("ETHEREUM_JSONRPC_VARIANT")) do

@ -2,4 +2,4 @@ use Mix.Config
config :logger, :indexer, config :logger, :indexer,
level: :warn, level: :warn,
path: "logs/test/indexer.log" path: Path.absname("logs/test/indexer.log")

@ -5,6 +5,6 @@ config :logger, :console, level: :info
config :logger, :ecto, config :logger, :ecto,
level: :debug, level: :debug,
path: "logs/dev/ecto.log" path: Path.absname("logs/dev/ecto.log")
config :logger, :error, path: "logs/dev/error.log" config :logger, :error, path: Path.absname("logs/dev/error.log")

@ -6,6 +6,6 @@ config :logger, :console, level: :info
config :logger, :ecto, config :logger, :ecto,
level: :info, level: :info,
path: "logs/prod/ecto.log" path: Path.absname("logs/prod/ecto.log")
config :logger, :error, path: "logs/prod/error.log" config :logger, :error, path: Path.absname("logs/prod/error.log")

@ -6,9 +6,9 @@ config :logger, :console, level: :warn
config :logger, :ecto, config :logger, :ecto,
level: :warn, level: :warn,
path: "logs/test/ecto.log" path: Path.absname("logs/test/ecto.log")
config :logger, :error, path: "logs/test/error.log" config :logger, :error, path: Path.absname("logs/test/error.log")
config :explorer, Explorer.ExchangeRates, config :explorer, Explorer.ExchangeRates,
source: Explorer.ExchangeRates.Source.NoOpSource, source: Explorer.ExchangeRates.Source.NoOpSource,

Loading…
Cancel
Save