Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Log salts hash (#5401)

ruslandoga811a0f049ac6
diff --git a/lib/plausible/session/salts.ex b/lib/plausible/session/salts.ex
index a088b8ea8c..75f770db43 100644
--- a/lib/plausible/session/salts.ex
+++ b/lib/plausible/session/salts.ex
@@ -1,6 +1,7 @@
defmodule Plausible.Session.Salts do
use GenServer
use Plausible.Repo
+ require Logger
def start_link(opts) do
GenServer.start_link(__MODULE__, opts, name: opts[:name] || __MODULE__)
@@ -26,9 +27,11 @@ defmodule Plausible.Session.Salts do
state =
case salts do
[current, prev] ->
+ Logger.notice("[salts] current salt hash: #{:erlang.phash2(current)}")
%{previous: prev, current: current}
[current] ->
+ Logger.notice("[salts] current salt hash: #{:erlang.phash2(current)}")
%{previous: nil, current: current}
[] ->
@@ -67,7 +70,7 @@ defmodule Plausible.Session.Salts do
defp generate_and_persist_new_salt(now) do
salt = :crypto.strong_rand_bytes(16)
-
+ Logger.notice("[salts] generated salt hash: #{:erlang.phash2(salt)}")
Repo.insert_all("salts", [%{salt: salt, inserted_at: now}])
salt
end