From 029082d65eeb5a8cd70d1f572e3e084f4ae9f523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20Caba=C3=A7o?= Date: Tue, 29 Oct 2024 16:16:28 +0000 Subject: [PATCH] fix: Allow setting log level (#1177) --- README.md | 10 +++++----- config/runtime.exs | 2 ++ docker-compose.yml | 1 + mix.exs | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6dbc29283..1dc715d6b 100644 --- a/README.md +++ b/README.md @@ -148,11 +148,11 @@ If you're using the default tenant, the URL is `ws://realtime-dev.localhost:4000 | TENANT_MAX_EVENTS_PER_SECOND | string | The default value of maximum events per second that each tenant can support, used when creating a tenant for the first time. Defaults to '100'. | | TENANT_MAX_JOINS_PER_SECOND | string | The default value of maximum channel joins per second that each tenant can support, used when creating a tenant for the first time. Defaults to '100'. | | SEED_SELF_HOST | boolean | Seeds the system with default tenant | -| RUN_JANITOR_AFTER_IN_MS | number | Tells system when to start janitor tasks after boot | -| RUN_JANITOR | boolean | Do you want to janitor tasks to run | -| MAX_CHILDREN_JANITOR_CLEANUP | number | Maximum number of concurrent tasks working on janitor cleanup | -| JANITOR_CLEANUP_TASK_TIMEOUT | number | Timeout for each async task for janitor cleanup | - +| RUN_JANITOR_AFTER_IN_MS | number | Tells system when to start janitor tasks after boot | +| RUN_JANITOR | boolean | Do you want to janitor tasks to run | +| MAX_CHILDREN_JANITOR_CLEANUP | number | Maximum number of concurrent tasks working on janitor cleanup | +| JANITOR_CLEANUP_TASK_TIMEOUT | number | Timeout for each async task for janitor cleanup | +| LOG_LEVEL | string | Sets the log value to the running instance. Valid values: debug; info; warning; error ## WebSocket URL The WebSocket URL is in the following format for local development: `ws://[external_id].localhost:4000/socket/websocket` diff --git a/config/runtime.exs b/config/runtime.exs index 8c25ad4ae..e5a8ba8ea 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -227,3 +227,5 @@ if System.get_env("LOGS_ENGINE") == "logflare" do config :logger, backends: [LogflareLogger.HttpBackend] end + +config :logger, level: System.get_env("LOG_LEVEL", "warning") |> String.to_existing_atom() diff --git a/docker-compose.yml b/docker-compose.yml index 758bcfc89..92563b997 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,3 +41,4 @@ services: RLIMIT_NOFILE: 1000000 DNS_NODES: "''" APP_NAME: realtime + LOG_LEVEL: "error" diff --git a/mix.exs b/mix.exs index c67ac3ed8..475d38914 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Realtime.MixProject do def project do [ app: :realtime, - version: "2.33.11", + version: "2.33.12", elixir: "~> 1.16.0", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod,