You can’t detect what you don’t log
For the longest break-ins, the time to discovery is still measured in months. Relevant evidence may be missing or already deleted by the time someone starts looking. Logging gets treated as a debugging tool; security needs something else: a trail of who did what, against which data, and with what outcome.
The question that exposes it
Ask your team this, and listen to the pause:
“If someone logged in with a stolen account last week and exported customer data, would we know?”
A team can have gigabytes of logs and still be unable to answer. Stack traces, performance numbers and “could not connect” help when something breaks. A successful export made with a stolen account need not look like an error.
M-Trends 2026 measured a median dwell time of 14 days in Mandiant’s 2025 investigations. For espionage and North Korean IT-worker cases, the median was 122 days in each category.
Put those 122 days beside the 90 days many teams keep their logs. By the time the investigation starts, the beginning of the intrusion may already have been deleted. Mandiant also describes attackers on network devices without standard endpoint telemetry. Reconstructing an export gets difficult when the trail is missing.
Security logging is a different genre
Debug logs and security logs share tools, but not purpose. The security view needs answers to four questions, for every event that matters:
Who (authenticated identity, not just an IP), did what (the action, semantically: “exported customer list”, not just “GET /api/export”), against what (which data, which customer, what scope), and with what outcome (did it succeed, and especially: did it fail on authorization?).
Include time and service too, as OWASP recommends. Use synchronized clocks and a correlation ID when the action crosses services. For a failed sign-in, distinguish an attempted username from an authenticated identity.
Denied attempts are valuable too: an account repeatedly probing resources it doesn’t own gives you something concrete to investigate. A single denial may just be a user mistake.
The events that should always be recorded that way: login and failed login, access changes, reads and exports of sensitive data, changes to configuration and secrets, and administrative actions. The list is short; the point is that it is kept the same way everywhere.
Three traps
The log that leaks. Eager logging that writes whole request objects captures passwords, tokens and personal data, and turns the log itself into a data store gone astray. A security log should answer who did what, not archive the contents.
The log nobody reads. A trail that gets written but never seen discovers nothing. You don’t need a round-the-clock operations center to get started: a handful of well-chosen alerts – login from a new country on a privileged account, an export over a threshold, a pile-up of authorization denials – beat zero. Agree who receives them and what they should do. Start where the consequences would be greatest.
The log the attacker edits. An intruder may try to clean up their traces. A security log must therefore be written away from the system it describes, as it happens, to a store where the system’s credentials only permit appending. They must not allow changes or deletion of existing records. Choose retention based on risk and need; Mandiant recommends well beyond 90 days to investigate long-running intrusions. And alert when the stream stops: logging can be switched off even if the records cannot be deleted. A log the attacker can delete is a diary, not a defense.
And “it’s just internal” doesn’t hold here either: the internal admin tools with the broadest access are exactly where the trail is needed most, and most often missing.
The clock already running
Prevention matters and will never be perfect. Something gets through. The question is whether you notice it in hour one or month four.
Try answering in a test environment. Have a test account export synthetic customer data at a volume that should trigger an alert. Find its time, identity, scope and outcome in the protected log, and check that the alert reaches the person who should respond. Then you can answer for that particular export, with the log in front of you.