← All topics

#privacy

4 min read

Logging Without Leaking Secrets or PII in PHP and Laravel

Do not log $request->all(), Authorization headers, cookies or passwords. Use Laravel's Log facade with a request id from Log::withContext() or shareContext(), and run context arrays through a redaction helper before writing them. Logs are often copied to Slack, files and log vendors — a secret in a log is a secret out of your app.

Get new briefs by email

Short alerts when a PHP or WordPress vulnerability needs action.

Double opt-in via Buttondown; unsubscribe any time. See our privacy policy.