From 2602d7a2ff3074faaf0ac1aac02a63893e80c00c Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Thu, 28 Nov 2024 16:04:07 +0200 Subject: [PATCH] Rename env vars to avoid confusion between log output and shape logs --- packages/sync-service/.env.dev | 4 ++-- packages/sync-service/.env.test | 2 +- packages/sync-service/config/runtime.exs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/sync-service/.env.dev b/packages/sync-service/.env.dev index 346d295c7d..9d9ed047fe 100644 --- a/packages/sync-service/.env.dev +++ b/packages/sync-service/.env.dev @@ -1,9 +1,9 @@ -LOG_LEVEL=debug +ELECTRIC_LOGGING_LEVEL=debug DATABASE_URL=postgresql://postgres:password@localhost:54321/electric?sslmode=disable ELECTRIC_ENABLE_INTEGRATION_TESTING=true ELECTRIC_CACHE_MAX_AGE=1 ELECTRIC_CACHE_STALE_AGE=3 # using a small chunk size of 10kB for dev to speed up tests -ELECTRIC_LOG_CHUNK_BYTES_THRESHOLD=10000 +ELECTRIC_SHAPE_CHUNK_BYTES_THRESHOLD=10000 # configuring a second database for multi-tenancy integration testing OTHER_DATABASE_URL=postgresql://postgres:password@localhost:54322/electric?sslmode=disable diff --git a/packages/sync-service/.env.test b/packages/sync-service/.env.test index dd48e6bbee..9ee7d94cd6 100644 --- a/packages/sync-service/.env.test +++ b/packages/sync-service/.env.test @@ -1,2 +1,2 @@ -LOG_LEVEL=info +ELECTRIC_LOGGING_LEVEL=info DATABASE_URL=postgresql://postgres:password@localhost:54321/postgres?sslmode=disable diff --git a/packages/sync-service/config/runtime.exs b/packages/sync-service/config/runtime.exs index 51532d3ad3..5e9209bc26 100644 --- a/packages/sync-service/config/runtime.exs +++ b/packages/sync-service/config/runtime.exs @@ -8,7 +8,7 @@ if config_env() in [:dev, :test] do end log_level_config = - env!("LOG_LEVEL", :string, "info") + env!("ELECTRIC_LOGGING_LEVEL", :string, "info") |> Electric.ConfigParser.parse_log_level() case log_level_config do @@ -19,14 +19,14 @@ case log_level_config do raise message end -if !env!("LOG_COLORS", :boolean, true) do +if !env!("ELECTRIC_LOGGING_COLORS", :boolean, true) do config :logger, :default_formatter, colors: [enabled: false] end # Enable this to get **very noisy** but useful messages from BEAM about # processes being started, stopped and crashes. # https://www.erlang.org/doc/apps/sasl/error_logging#sasl-reports -sasl? = env!("ELECTRIC_LOG_OTP_REPORTS", :boolean, false) +sasl? = env!("ELECTRIC_LOGGING_OTP_REPORTS", :boolean, false) config :logger, handle_otp_reports: false, @@ -130,7 +130,7 @@ persistent_kv = chunk_bytes_threshold = env!( - "ELECTRIC_LOG_CHUNK_BYTES_THRESHOLD", + "ELECTRIC_SHAPE_CHUNK_BYTES_THRESHOLD", :integer, Electric.ShapeCache.LogChunker.default_chunk_size_threshold() )