Menu

Logging provider failures to a rotating file: enough detail to debug, nothing about the user
📰

Logging provider failures to a rotating file: enough detail to debug, nothing about the user

DEV Community: php·Mobeen Ahmed·about 18 hours ago
#gaIerrlo
#devto#dev#provider#file#platform
Long article (680 words) — no AI summary yet.
Reading 0:00
15s threshold

When a provider goes down, the first thing I want to know is exactly what happened — and the last thing I want is a log full of my visitors' personal details. Those two wants pull in opposite directions, and getting the balance right took me longer than I expected while building ramrom.io , my free video downloader.

The problem with logging everything

My first attempt logged the whole provider response, including the URL the visitor pasted. That felt thorough. Then I read one of those logs back and realised what I was actually keeping: the exact video links real people had pasted, complete with their usernames in the query strings, their tracking parameters, and sometimes the name of the account that posted the video. I was storing other people's browsing habits in a plain text file on shared hosting. That was the day the logging got a redesign.

A downloader only needs a URL for a few seconds. Once the resolve call is done, that URL has no business sitting in a file on my server.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.