* Fix error loading sessions after a restart

* Add logflare logger
This commit is contained in:
Uku Taht 2020-10-15 15:57:30 +03:00 committed by GitHub
parent 78ab16baa8
commit d463814da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -44,7 +44,9 @@ geolite2_country_db = System.get_env("GEOLITE2_COUNTRY_DB")
disable_auth = String.to_existing_atom(System.get_env("DISABLE_AUTH", "false"))
hcaptcha_sitekey = System.get_env("HCAPTCHA_SITEKEY")
hcaptcha_secret = System.get_env("HCAPTCHA_SECRET")
logflare_api_key = System.get_env("LOGFLARE_API_KEY")
logflare_source_id = System.get_env("LOGFLARE_SOURCE_ID")
log_level = String.to_existing_atom(System.get_env("LOG_LEVEL", "warn"))
config :plausible,
admin_user: admin_user,
@ -192,4 +194,17 @@ if geolite2_country_db do
]
end
config :logger, level: :warn
logger_backends = case logflare_api_key do
api_key when is_binary(api_key) -> [LogflareLogger.HttpBackend]
_ -> [:console]
end
config :logger,
level: log_level,
backends: logger_backends
if logflare_api_key do
config :logflare_logger_backend,
api_key: logflare_api_key,
source_id: logflare_source_id
end

View File

@ -90,7 +90,8 @@ defmodule Plausible.MixProject do
{:sshex, "2.2.1"},
{:geolix, "~> 1.0"},
{:clickhouse_ecto, git: "https://github.com/plausible/clickhouse_ecto.git"},
{:geolix_adapter_mmdb2, "~> 0.5.0"}
{:geolix_adapter_mmdb2, "~> 0.5.0"},
{:logflare_logger_backend, "~> 0.7.6"},
]
end