fix: demote geolocation request logs #29

Merged
graham merged 2 commits from fix/w13-geolocation-logs into main 2026-09-15 16:33:43 -05:00
Owner

Fixes W13 from bugs.md.

Demotes all four IPGeolocation log lines from :info to :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.

Fixes W13 from bugs.md. Demotes all four `IPGeolocation` log lines from `:info` to `: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.
fix: demote geolocation request logs
All checks were successful
Elixir CI / Dialyzer (pull_request) Successful in 37s
skippy-bot/review Skippy review: clean — 1 non-blocking note open
Elixir CI / Build and test (pull_request) Successful in 1m39s
Elixir CI / Build and Push Docker Image (pull_request) Has been skipped
a97b37fb73
skippy-bot left a comment

🤖 Skippy PR review

2 findings — none blocking.

Severity Location Issue
🔵 Suggestion lib/aprsme_web/plugs/ip_geolocation.ex:51 Untrusted-peer line is the CF-bypass signal, not per-request noise
🔵 Suggestion lib/aprsme_web/live/map_live/navigation.ex:26 Same geolocation logs still at :info one layer down (W13 only half fixed)

Findings outside the commentable diff

  • 🔵 Suggestion — 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/2 logs 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 :info lines 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.debug at 26/35/42/48.

Reviewed a97b37fb73f6. Comment skippy review to re-run.

### 🤖 Skippy PR review **2 findings** — none blocking. | Severity | Location | Issue | | --- | --- | --- | | 🔵 Suggestion | `lib/aprsme_web/plugs/ip_geolocation.ex:51` | Untrusted-peer line is the CF-bypass signal, not per-request noise | | 🔵 Suggestion | `lib/aprsme_web/live/map_live/navigation.ex:26` | Same geolocation logs still at :info one layer down (W13 only half fixed) | #### Findings outside the commentable diff - **🔵 Suggestion — `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/2` logs 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 `:info` lines 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.debug` at 26/35/42/48. <sub>Reviewed `a97b37fb73f6`. Comment `skippy review` to re-run.</sub> <!-- skippy-pr-review -->
@ -49,3 +49,3 @@
end
else
Logger.info("Ignoring Cloudflare geolocation headers from untrusted peer")
Logger.debug("Ignoring Cloudflare geolocation headers from untrusted peer")
First-time contributor

🔵 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 :debug with config :logger, level: :info in prod it becomes invisible. Consider leaving this one line at :info (or :warning) and demoting only lines 34/43/47.

**🔵 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 `:debug` with `config :logger, level: :info` in prod it becomes invisible. Consider leaving this one line at `:info` (or `:warning`) and demoting only lines 34/43/47.
fix: demote remaining map navigation info logs to debug
All checks were successful
skippy-bot/review Skippy review: clean — 1 non-blocking note open
Elixir CI / Build and test (pull_request) Successful in 58s
Elixir CI / Dialyzer (pull_request) Successful in 2m52s
Elixir CI / Build and Push Docker Image (pull_request) Has been skipped
d4eb8be2be
First-time contributor

Resolved the second earlier finding: MapLive.Navigation lines 26/35/42/48 are Logger.debug now, 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:51 is 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.

Resolved the second earlier finding: `MapLive.Navigation` lines 26/35/42/48 are `Logger.debug` now, 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:51` is 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. <!-- skippy-pr-review -->
graham merged commit dc551a9040 into main 2026-09-15 16:33:43 -05:00
graham deleted branch fix/w13-geolocation-logs 2026-09-15 16:33:43 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
graham/aprs.me!29
No description provided.