Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Revert "Include query string when logging the request (#3971)" (#3984)
Adrian Gruntkowskiacbd2f8e308d
diff --git a/lib/plausible/application.ex b/lib/plausible/application.exindex ee917857cf..f197ec6a06 100644--- a/lib/plausible/application.ex+++ b/lib/plausible/application.ex@@ -100,7 +100,6 @@ defmodule Plausible.Application doopts = [strategy: :one_for_one, name: Plausible.Supervisor]- setup_request_logging()setup_sentry()setup_opentelemetry()@@ -176,15 +175,6 @@ defmodule Plausible.Application doendend- def setup_request_logging() do- :telemetry.attach(- "plausible-request-logging",- [:phoenix, :endpoint, :stop],- &Plausible.RequestLogger.log_request/4,- %{}- )- end-def setup_sentry() doLogger.add_backend(Sentry.LoggerBackend)diff --git a/lib/plausible/request_logger.ex b/lib/plausible/request_logger.exdeleted file mode 100644index 747d66f10d..0000000000--- a/lib/plausible/request_logger.ex+++ /dev/null@@ -1,19 +0,0 @@-defmodule Plausible.RequestLogger do- @moduledoc """- Custom request logger which:- - Includes query parameters on the same line- - Includes request duration on the same line- """-- require Logger-- def log_request(_, %{duration: duration}, %{conn: conn}, _) do- duration_ms = System.convert_time_unit(duration, :native, :millisecond)- path = path_with_params(conn.request_path, conn.query_string)-- Logger.info("(#{conn.status}) #{conn.method} #{path} took #{duration_ms}ms")- end-- defp path_with_params(request_path, ""), do: request_path- defp path_with_params(request_path, query_string), do: request_path <> "?" <> query_string-enddiff --git a/lib/plausible_web/endpoint.ex b/lib/plausible_web/endpoint.exindex 8b83b084c1..0cc4c91b98 100644--- a/lib/plausible_web/endpoint.ex+++ b/lib/plausible_web/endpoint.ex@@ -69,7 +69,7 @@ defmodule PlausibleWeb.Endpoint doplug(Plug.RequestId)plug(PromEx.Plug, prom_ex_module: Plausible.PromEx)- plug(Plug.Telemetry, event_prefix: [:phoenix, :endpoint], log: false)+ plug(Plug.Telemetry, event_prefix: [:phoenix, :endpoint])plug(Plug.Parsers,parsers: [:urlencoded, :multipart, :json],