Merge branch 'apps-api-endpoint' into 'develop'
[akkoma] / lib / pleroma / telemetry / logger.ex
index 0f73ecc02e6c5bd2a4b078dfcc1c00b263e80683..35e245237ec5abf5004b890df5e273eddd1ac247 100644 (file)
@@ -35,9 +35,7 @@ defmodule Pleroma.Telemetry.Logger do
         _
       ) do
     Logger.debug(fn ->
-      "Connection pool is exhausted (reached #{max_connections} connections). Starting idle connection cleanup to reclaim as much as #{
-        reclaim_max
-      } connections"
+      "Connection pool is exhausted (reached #{max_connections} connections). Starting idle connection cleanup to reclaim as much as #{reclaim_max} connections"
     end)
   end
 
@@ -79,9 +77,7 @@ defmodule Pleroma.Telemetry.Logger do
         _
       ) do
     Logger.warn(fn ->
-      "Pool worker for #{key}: Client #{inspect(client_pid)} died before releasing the connection with #{
-        inspect(reason)
-      }"
+      "Pool worker for #{key}: Client #{inspect(client_pid)} died before releasing the connection with #{inspect(reason)}"
     end)
   end
 
@@ -106,7 +102,9 @@ defmodule Pleroma.Telemetry.Logger do
       ) do
     logging_config = Pleroma.Config.get([:telemetry, :slow_queries_logging], [])
 
-    if logging_config[:min_duration] && query_time > logging_config[:min_duration] and
+    if logging_config[:enabled] &&
+         logging_config[:min_duration] &&
+         query_time > logging_config[:min_duration] and
          (is_nil(logging_config[:exclude_sources]) or
             source not in logging_config[:exclude_sources]) do
       log_slow_query(measurements, metadata, config)