mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
There was slight API change in the way LoggerJSON's configuration is
generation, so I took the time to do a little fixing and cleanup here.
Specifically, we should be using the `new/1` callback to create the
Logger config which fixes the below exception due to missing config
keys:
```
FORMATTER CRASH: {report,[{formatter_crashed,'Elixir.LoggerJSON.Formatters.GoogleCloud'},{config,[{metadata,{all_except,[socket,conn]}},{redactors,[{'Elixir.LoggerJSON.Redactors.RedactKeys',[<<"password">>,<<"secret">>,<<"nonce">>,<<"fragment">>,<<"state">>,<<"token">>,<<"public_key">>,<<"private_key">>,<<"preshared_key">>,<<"session">>,<<"sessions">>]}]}]},{log_event,#{meta => #{line => 15,pid => <0.308.0>,time => 1744145139650804,file => "lib/logger.ex",gl => <0.281.0>,domain => [elixir],application => libcluster,mfa => {'Elixir.Cluster.Logger',info,2}},msg => {string,<<"[libcluster:default] connected to :\"web@web.cluster.local\"">>},level => info}},{reason,{error,{badmatch,[{metadata,{all_except,[socket,conn]}},{redactors,[{'Elixir.LoggerJSON.Redactors.RedactKeys',[<<"password">>,<<"secret">>,<<"nonce">>,<<"fragment">>,<<"state">>,<<"token">>,<<"public_key">>,<<"private_key">>,<<"preshared_key">>,<<"session">>,<<"sessions">>]}]}]},[{'Elixir.LoggerJSON.Formatters.GoogleCloud',format,2,[{file,"lib/logger_json/formatters/google_cloud.ex"},{line,148}]}]}}]}
```
Supersedes #8714
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
63 lines
1.4 KiB
Elixir
63 lines
1.4 KiB
Elixir
import Config
|
|
|
|
###############################
|
|
##### Domain ##################
|
|
###############################
|
|
|
|
config :domain, Domain.Repo,
|
|
pool_size: 10,
|
|
show_sensitive_data_on_connection_error: false
|
|
|
|
###############################
|
|
##### Web #####################
|
|
###############################
|
|
|
|
config :web, Web.Endpoint,
|
|
cache_static_manifest: "priv/static/cache_manifest.json",
|
|
server: true
|
|
|
|
###############################
|
|
##### API #####################
|
|
###############################
|
|
|
|
config :api, API.Endpoint, server: true
|
|
|
|
###############################
|
|
##### Third-party configs #####
|
|
###############################
|
|
|
|
secret_keys = [
|
|
"password",
|
|
"secret",
|
|
"nonce",
|
|
"fragment",
|
|
"state",
|
|
"token",
|
|
"public_key",
|
|
"private_key",
|
|
"preshared_key",
|
|
"session",
|
|
"sessions"
|
|
]
|
|
|
|
config :phoenix, :filter_parameters, secret_keys
|
|
|
|
# Do not print debug messages in production and handle all
|
|
# other reports by Elixir Logger with JSON back-end so that.
|
|
# we can parse them in log analysis tools.
|
|
# Notice: SASL reports turned off because of their verbosity.
|
|
# Notice: Log level can be overridden on production with LOG_LEVEL environment variable.
|
|
config :logger,
|
|
handle_sasl_reports: false,
|
|
handle_otp_reports: true
|
|
|
|
config :logger_json, :config,
|
|
metadata: {:all_except, [:socket, :conn, :otel_trace_flags]},
|
|
redactors: [
|
|
{LoggerJSON.Redactors.RedactKeys, secret_keys}
|
|
]
|
|
|
|
config :logger, level: :info
|
|
|
|
config :swoosh, local: false
|