An audit log should explain an action without copying the credential that authorized it. Logging a whole request often collects passwords, access tokens and private data alongside the useful fields. A second problem appears when untrusted text contains a line break and imitates another event.
You'll project a small event into a safer log entry. Preserve the actor and outcome, remove the credential and normalize the control characters used by this export format. The response stands in for the stored entry so the checker can inspect it. A production logger also needs a structured encoder, access restrictions, retention rules and monitoring for delivery failures.
Redaction after publication is too late.
Read the fixed handler, then apply the same idea to each exercise.