fix: demote geolocation request logs #29
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/w13-geolocation-logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes W13 from bugs.md.
Demotes all four
IPGeolocationlog lines from:infoto:debug. The plug runs on every anonymous browser request and wrote 2-3 lines each — pure per-request noise in production logs.Verification: focused plug tests passed (93), full suite passed (2235),
mix credo --strict, and commit hooks including Dialyzer passed.🤖 Skippy PR review
2 findings — none blocking.
lib/aprsme_web/plugs/ip_geolocation.ex:51lib/aprsme_web/live/map_live/navigation.ex:26Findings outside the commentable diff
lib/aprsme_web/live/map_live/navigation.ex:26— Same geolocation logs still at :info one layer down (W13 only half fixed)MapLive.Navigation.determine_map_location/2logs the identical thing at:info, and it is called on every map mount: line 26 dumps the session value, then one of line 35 (URL params), 42 (Using IP geolocation: lat=…, lng=…) or 48 fires — so a map page load still writes 2:infolines per anonymous visitor in prod, including the coordinates. Demoting the plug's lines leaves the noise (and the coords-in-logs) that W13 is about. Same one-line change here:Logger.debugat 26/35/42/48.Reviewed
a97b37fb73f6. Commentskippy reviewto re-run.@ -49,3 +49,3 @@endelseLogger.info("Ignoring Cloudflare geolocation headers from untrusted peer")Logger.debug("Ignoring Cloudflare geolocation headers from untrusted peer")🔵 Suggestion — Untrusted-peer line is the CF-bypass signal, not per-request noise
This branch only fires when the raw TCP peer is NOT in
TRUSTED_PROXY_CIDRS/the Cloudflare ranges — i.e. something reached the origin without passing through Cloudflare, or the trusted-proxy list regressed (which silently disables session geolocation for every visitor). It is rare by construction, so it isn't part of the 2-3 lines/request you're fixing; at:debugwithconfig :logger, level: :infoin prod it becomes invisible. Consider leaving this one line at:info(or:warning) and demoting only lines 34/43/47.Resolved the second earlier finding:
MapLive.Navigationlines 26/35/42/48 areLogger.debugnow, so W13's other half is done. That one had no inline thread to close, so 1 of 2 findings is cleared by this push.Still open (suggestion, non-blocking):
lib/aprsme_web/plugs/ip_geolocation.ex:51is still:debug. Leaving it there looks deliberate, so no blocker from me, just noting the flag stands.Nothing new in
a97b37f..d4eb8be; the push is a pure log-level change.