A log (a record that a system creates automatically, such as who logged in, when, did what, and from where) is the data used to detect and investigate security incidents. Log management is the process of generating, transmitting, storing, accessing and disposing of logs, as NIST describes it in the draft revision of SP 800-92. The common questions are what to log and how long to keep it. This article answers from public guidance and says clearly which parts need confirmation from the organization's legal owner. It is not legal advice.

Log management is a five-part process

The officially published and not yet replaced edition of SP 800-92 is the 2006 Guide to Computer Security Log Management. SP 800-92 Rev. 1 (Cybersecurity Log Management Planning Guide) is an initial public draft released for comment on 11 October 2023. NIST's project page, which we opened in November 2026, says NIST is still addressing the public comments on this draft, and we found no final version. The draft will replace the 2006 edition once it is finalized, and it focuses on organization-wide planning rather than the details of implementing tools.

The draft revision defines log management as a process covering these five things:

  • Generate: a system or application records what happened
  • Transmit: send logs from the source machine to a central store
  • Store: keep logs for the defined period
  • Access and use: search, review and analyze logs
  • Dispose: delete or destroy logs when they are no longer needed
INFOGRAPHIC
Log management in five parts
1
Generate
the system records what happened
2
Transmit
send to a central store
3
Store
keep for the defined period
4
Access and use
search, review, analyze
5
Dispose
delete when no longer needed

Our view: seeing it as five parts helps separate the two questions in this article. What to log belongs to the generate and transmit parts, and how long to keep it belongs to the store and dispose parts.

What to log

NIST SP 800-92 (2006) gives no fixed list of logs to collect. Instead it has organizations write a policy stating which types of hosts must log, which components log (for example the operating system, services and applications), which types of events they log (for example security events, network connections and authentication attempts), and which data each event must carry (for example the username and source IP address of a login attempt). NIST says to balance risk reduction against the time and resources needed.

On prioritization, CISA, together with ASD's ACSC (Australia's cyber security centre) and partners, published Best Practices for Event Logging and Threat Detection on 21 August 2024, which sets a baseline for event logging, and Priority Logs for SIEM Ingestion on 27 May 2025, which offers insights on prioritizing which logs go into a SIEM (a system that collects and analyzes logs from many sources) first. We could open only CISA's announcement pages and not the full PDFs, so we do not summarize the lists of logs in those documents.

Our view: if you have no list yet, start with these five groups of log sources, which answer the basic investigation questions of who came in, what they did and where they went:

  • Authentication and privileges: successful and failed logins, MFA (multi-step login verification) use, privilege changes, and account creation or deletion
  • User machines and servers: operating system security events and logs from EDR (software that detects and responds on the machine)
  • Network: firewalls, VPN (a secure connection from outside into the organization's network), DNS (the system that turns website names into IP addresses) and proxy (an intermediary that forwards web access)
  • Cloud and SaaS: audit logs (records of administrator and user actions) of the services in use; SaaS is cloud software that the provider runs for you
  • Key applications and databases: access to sensitive data, and administrator actions
INFOGRAPHIC
Five log source groups to have first
Logs to have first
who, what, where (our view)
Authentication and privileges
logins, MFA, privilege changes
User machines and servers
operating system and EDR
Network
firewall, VPN, DNS, proxy
Cloud and SaaS
audit logs of services in use
Key apps and databases
sensitive access, admin actions

Each log entry should say at least who did what, when and from where (our view, consistent with the examples NIST gives). Time must agree across systems. NIST notes that systems with out-of-sync clocks make it hard to compare logs across systems, and that systems may use different time zones, so use NTP (a network time synchronization service) to keep the clocks of log sources consistent.

Take care that logs do not capture secrets by accident. NIST has the policy cover how to handle inadvertent disclosures of sensitive information recorded in logs, such as passwords or the contents of emails. For the details of cloud logs, see Cloud Logging and Detection: What to Log.

How long to keep logs

No single number fits every organization. NIST SP 800-92 (2006) sets no number of days; it has the policy state how long each type of log must or should be kept, at both the system level and the central-store level. The Rev. 1 draft also asks commenters whether guidance on determining retention periods should be included.

These are the factors to use when setting a retention period (our view, except the first, which the NIST draft lists as requirements for logs to check):

  • Laws, sector-specific requirements and standards the organization chooses: the NIST draft has these checked together with the organization's own policies
  • Investigation needs: how far back you must be able to look
  • Storage cost: NIST notes that in some cases logs that need not be archived are filtered out because of volume
  • Privacy: logs containing personal data should not be kept longer than necessary; see the law section below

NIST separates long-term keeping into two kinds. Log retention is archiving logs on a regular basis as part of normal operations. Log preservation is keeping logs that would normally be discarded because they record activity of particular interest, typically to support incident handling or investigations. When an incident happens, the related logs must therefore be set aside so the regular cycle does not delete them. See Digital Forensics Basics: Preserve Evidence Properly.

INFOGRAPHIC
Normal logs and logs set aside
01
Log generated
the system records an event
02
Kept on the cycle
retention under policy
03
Incident to investigate
logs still in the cycle
04
Set logs aside
preservation, no deletion on cycle

If logs must be kept for months or years, NIST says administrators typically need to do the following:

  • Choose a file format: logs in a vendor-specific format may be unreadable years later, so consider keeping both the original and a standard format
  • Choose storage that fits the data's lifetime: if the media lasts less than the retention period, plan to move the data before the media wears out
  • Verify integrity: use a hash (a short value that changes when the data changes) to compare the original file with the transferred one
  • Store media securely and destroy at the end: prevent physical access, and destroy according to the organization's policy

Thai law: what can be verified from official sources

This section is not legal advice. We can check only text published by official sources or the copies named here, and laws may be amended later. The organization's legal owner must confirm log retention periods before they are written into policy, including any sector-specific or regulator requirements that apply to each organization, which we did not check.

Section 26 of the Computer-Related Crime Act B.E. 2550 (2007), as amended by the Act (No. 2) B.E. 2560 (2017), requires a service provider to retain computer traffic data for not less than 90 days from the date the data enters the computer system. Traffic data is data about communication through a computer system that shows the origin, source, destination, route and time, among other things. In a case of necessity, a competent official may order a particular provider to retain data for more than 90 days but not more than two years, as a special measure for that provider and that occasion only. We read this from the legal text prepared by the Office of the Council of State, in a file published by the Ministry of Digital Economy and Society. The file is hard to read because the character extraction is garbled, so we summarize in our own words.

Section 26 applies to a "service provider", which the Act defines in two ways. The first is a provider that gives other people access to the internet or lets them communicate through a computer system. The second is a provider that stores computer data for the benefit of other people. The Act also has the minister announce in the Royal Gazette which types of provider must retain data, how, and when. Search results show that a 2021 (B.E. 2564) notification of the Ministry of Digital Economy and Society exists on this, but we could not open the notification in the Royal Gazette, so we do not summarize its details. The 90-day figure is therefore not automatically the log retention period for every organization. Whether your organization counts as a provider under this definition must be decided by your legal team.

Section 37 of the PDPA (Thailand's Personal Data Protection Act B.E. 2562 (2019)) sets duties for the data controller. In the unofficial English translation we read, these duties include providing appropriate security measures to prevent unauthorized or unlawful loss, access, use, alteration, correction or disclosure of personal data, and putting in place a system to check for erasure or destruction of personal data when the retention period ends or the data is irrelevant or beyond what is necessary, except for the listed exceptions such as retention for compliance with the law. We have not compared this with the Thai text in the Royal Gazette.

Our view: logs that contain identifying information, such as usernames, may count as personal data, so the legal team or the person responsible for data protection should consider both the retention period and the limits on who can access them. See PDPA and Security Measures for Security Teams.

Keeping logs usable: protect, centralize, review

Beyond generating and storing logs, NIST SP 800-92 has the log policy cover the following as well:

  • Log transmission: which hosts must send, what they send, how, and how logs are protected in transit
  • Storage space: how much space must be available and what happens when logs fill up, for example overwriting the oldest entries or stopping the log generator
  • Log preservation: how logs that must be kept under a legal requirement are marked, stored and protected
  • Access and analysis: who can access logs (and how those accesses are logged), how often they are reviewed, and what to do when something suspicious is found

NIST states that a secure log management infrastructure helps preserve the integrity of log data against accidental or intentional modification or deletion, and helps keep logs confidential. It also has to handle peak volumes of logs, for example during a widespread malware incident or a vulnerability scan. A SIEM, as NIST describes it, analyzes logs from many sources, correlates events across them and prioritizes significant events. For a comparison of tools, see SIEM, SOAR and XDR Compared: Strengths and Limits.

Common mistakes

  • Keeping logs on the machine that is attacked: an attacker who controls the machine can alter or delete those logs
  • Letting logs fill up with no warning: NIST gives the example that many log sources can warn when they are around 80 or 90 percent full, but this has to be set up beforehand
  • Leaving each system's clock out of sync: events cannot be put in order across systems
  • Using 90 days as every organization's retention period: when section 26 speaks of providers as defined and of the minister's notification
  • Letting logs hold passwords or secrets: the logs become a source of leaks themselves
  • Having no procedure to set logs aside during an incident: logs needed for the investigation get deleted on the regular cycle
  • Turning on every log without knowing what question it answers: volume becomes too large to search and storage costs rise (our view)

Start today

  • Write down the investigation questions you must be able to answer: for example who logged in to this machine and when, then see which logs are needed to answer them (our view)
  • Make an inventory of log sources: which systems have logging on, which do not, and where the logs go
  • Synchronize clocks: use NTP on the machines and devices that generate logs
  • Send key logs off the machine: start with authentication and administrator logs
  • Ask the organization's legal owner: what laws, contracts and regulators set for log retention, then write it into the policy together with how logs are set aside during an incident

To see where your organization stands, try the self-assessment.

References and further reading