Estimated reading time : 4 min · Published
Start with questions the logs should answer
List operational questions: is a form failing, is a process interrupted, has a backup been tested? Define the event, component, time and an appropriate correlation identifier. Avoid messages that collect text without helping identify an action.
Prepare synthetic examples of success, refusal and failure. An expected refusal should be distinguishable from an outage. Event names and levels should help the owner decide whether to investigate or monitor a trend.
Connect events from one interaction with a controlled diagnostic identifier without copying a session token. Fictitious example: form.saved and mail.failed both carry DEMO-REQ-21. The first describes saving, the second an email sending failure; neither should erase the meaning of the other. Also distinguish event time from collection time when processing is deferred.
Visitor-supplied values remain untrusted data in logs. Encode carriage returns CR, line feeds LF and separators for the chosen format so that a field cannot fabricate another entry. Structured JSON does not automatically remove secrets: allowed fields, encoding and size limits are still necessary. Inspect the actual output using fictitious markers, never real passwords.
Scroll the table horizontally to read every column. With a keyboard, focus the table area and use the arrow keys.
| Retained signal | Limited interpretation | Check to perform |
|---|---|---|
| form.saved with DEMO-REQ-21 | The saving step succeeded. | Check the stored result without inferring email delivery. |
| mail.failed with DEMO-REQ-21 | A sending step failed for the same interaction. | Start the appropriate follow-up without assuming the enquiry was lost. |
| Event time and collection time | They describe two potentially different moments. | Retain time zone and source; do not reconstruct order only from line arrival. |
| External value containing CR or LF | It remains a field rather than a new event. | Check encoding, size and absence of secrets in the actual output. |
- OWASP : Logging
Consulted on 22 October 2026; interaction identifiers, separate timestamps, excluded data and prevention of log injection.
Minimise recorded information
OWASP discusses data that should be excluded from logs, including passwords, access tokens and sensitive information. Review messages produced by your code as well as plugins, proxies and monitoring services.
Use an allowlist of fields instead of copying an entire request. A diagnostic identifier may suffice where a full enquiry message would be excessive. Test with synthetic markers, then search outputs for those markers to detect unintended collection.
Scroll the table horizontally to read every column. With a keyboard, focus the table area and use the arrow keys.
| Situation or setting | What it means | Useful check |
|---|---|---|
| Operation failed | Technical reference, time, failure category and useful status. | Find the incident without copying the visitor’s private message. |
| Authentication | Outcome and a correlation reference suited to the purpose. | Exclude passwords, access tokens and usable session identifiers. |
| Visitor input | Error category rather than full content where sufficient. | Handle line breaks and other characters that could forge a log entry. |
Manage access, retention and volume
Document who can read logs and why. Confirm they are not served from a public address or made accessible by sharing tools. A diagnostic export needs the same access review as primary storage.
Choose retention according to the actual need and applicable context rather than copying another service’s duration. Arrange rotation, volume limits and deletion. A repeated failure should not fill a disk through unlimited logging.
Test the path from signal to action
Trigger a controlled failure in a test environment. Check the log, alert delivery, recipient and response procedure. An alert sent to an inbox no one checks does not form an operational process.
Group repetitions and follow signals that support decisions. After an incident, review what was missing and what was unnecessarily exposed. A useful deliverable connects an event with minimum data, an owner and an action.
Primary documentation : OWASP : Logging Cheat Sheet.
Limit disclosure of a page’s path and parameters to linked websites.
Synthetic case: an external link starts from a URL containing a fictitious case identifier. Observe the Referer header on a test destination under the selected policy. Also remove sensitive information from source URLs: limiting referrer data does not erase browser history or previously created logs.
- Requests disclose only intended referrer information; no real personal identifier is used in the check.
- MDN Referrer-Policy
Reference for controlling referrer information included in outgoing browser requests.
Reference documents
- MDN Referrer-Policy · Source consulted
- OWASP : Logging Cheat Sheet · Source consulted
Content updated on
Documented reference points for this topic
| Reference | Value or syntax | Scope |
|---|---|---|
| RFC 3339 · Date-time | 2026-10-22T09:00:00+02:00 | The explicit offset relates local time to UTC; this example is not an appointment. |
Dates indicate when references were consulted. These facts are neither a site audit nor an overall compliance statement.
