TapCub is live — analytics, insights and live chat, free on one platform
Glossary

What is an audit log? Fields and retention with examples

An audit log records who did what, when, from where and with what result. Required fields, sample entries, retention starting points from NIST and a tamper-evidence example.

Su He Reviewed by Ethan Brooks Also called audit logging Last updated Dec 3, 2026 Glossary

Quick answer

An audit log is a chronological, protected record of actions that matter for accountability: who did what, to which object, when, from where and with what result. It is kept so events can be reconstructed later, and is guarded against quiet editing or deletion.

What is an audit log?

An audit log is a chronological record of actions in a system that matter for accountability: who did what, to which object, when, from where and with what result. Its purpose is to let someone reconstruct events afterwards, for example to answer "who changed this permission on Tuesday?" or "did anyone export the customer list?".

NIST's security control catalogue, SP 800-53, states the requirement in control AU-3: audit records must establish what type of event occurred, when it occurred, where it occurred, the source of the event, its outcome, and the identity of any individuals, subjects or objects associated with it.

Two properties separate an audit log from ordinary diagnostic output. The entries are selected in advance because someone will need them as evidence, and they are protected so that the people whose actions are recorded cannot quietly rewrite them.

What should an audit log record?

AU-3 elementTypical fieldExample value
What type of eventactionmember.role_changed
Whentime, in UTC with offset2026-12-01T09:14:02Z
Whereservice or componentadmin-console
Sourceip, device or calling system203.0.113.7
Outcomeresultsuccess or failure
Identityactor and targetana@example.com → user:42

For changes, add the before and after values (viewer → admin); "role changed" alone does not tell you whether someone gained or lost access. For times, NIST control AU-8 asks for timestamps from internal clocks that use UTC or carry the offset from it. If servers disagree about the time, the order of events across them cannot be trusted.

Deciding which events to log is a separate step. NIST control AU-2 mentions password changes, failed logons, changes to security or privacy attributes and use of administrative privileges among the event types, and asks organizations to say why the chosen set is enough to support investigations. NIST SP 800-92 gives similar examples of audit records in operating systems: successful and failed authentication attempts, file accesses, policy changes, account changes and use of privileges.

Audit log example

Sample data, four entries from an admin system:

Time (UTC)ActorActionTarget and changeResultSource IP
2026-12-01 09:14:02ana@example.commember.role_changeduser:42, viewer → adminsuccess203.0.113.7
2026-12-01 09:20:41ana@example.comexport.createdproject:7, CSVsuccess203.0.113.7
2026-12-01 22:03:10unknownlogin.faileduser:42, bad passwordfailure198.51.100.23
2026-12-01 22:03:58ben@example.comlogin.succeededuser:42success198.51.100.23

Read together, the rows raise a question that no single row does. An account was promoted in the morning; that evening someone failed once and then signed in to it, from an address that appears nowhere earlier in these rows. That may be the owner mistyping a password at home. It is still worth a check, because the account now has admin rights. The log supplies the facts; a person supplies the judgement.

Audit log vs application log vs access log

Audit logApplication logAccess log
QuestionWho did what, and was it allowed?Why did the software behave this way?Which requests reached the server?
Main readerSecurity, compliance, account ownersDevelopers and operationsOperations, SEO and security
EntriesSelected actions with actor and targetErrors, warnings, debug tracesOne line per request
Edits and deletionRestricted and detectableRotated freelyUsually rotated on a schedule
Typical contentrole changed, export createdstack trace, retry countURL, status code, user agent

One event can feed all three: a failed export appears as a request in the access log, an exception in the application log and a failure entry in the audit log. Server access logs have other uses, such as log file analysis for SEO. Deciding who owns each log, who may read it and how long it lives belongs to data governance.

How long should audit logs be kept?

NIST SP 800-92 (2006), the Guide to Computer Security Log Management, gives example policy settings by system impact level and says organizations should not adopt them as they are but use them as a starting point:

Setting (example)Low impactModerate impactHigh impact
How long to retain log data1 to 2 weeks1 to 3 months3 to 12 months
Integrity checking of rotated logsOptionalYesYes
Encryption of rotated logsOptionalOptionalYes

The same guide notes that these examples do not include requirements from laws and regulations, which may be considerably higher, and that preservation for an investigation should override the standard period. NIST SP 800-53 AU-11 leaves the number to the organization: long enough to support after-the-fact investigations and to meet regulatory retention requirements. A revision of SP 800-92 has been in public draft since October 2023. This is general information, not legal advice; check the rules that apply to your sector and country as of the date you write your policy.

Storage is rarely the obstacle for audit records. Sample estimate: 40 staff × 25 audited actions a day = 1,000 entries a day. At 800 bytes per entry that is 0.8 MB a day and about 292 MB a year. The harder question is personal data: entries name people, so keeping them longer than you can justify is its own risk. Record the period and the reason in your data retention policy.

How to make an audit log tamper-evident

NIST control AU-9 requires protecting audit information and logging tools from unauthorized access, modification and deletion, and alerting named people when any of these is detected. SP 800-92 describes log file integrity checking: calculate a message digest of each archived file and store the digest securely, so later changes are detected.

A digest changes completely when the input changes. One way to apply this record by record is a hash chain, where each digest covers the previous digest plus the new line. Sample lines:

2026-12-01T09:14:02Z,ana@example.com,member.role_changed,user:42,viewer->admin,success,203.0.113.7
2026-12-01T09:20:41Z,ana@example.com,export.created,project:7,csv,success,203.0.113.7
2026-12-01T22:03:10Z,unknown,login.failed,user:42,bad_password,failure,198.51.100.23

With SHA-256, starting from 64 zeros and hashing "previous digest + line" (first 16 hex characters shown):

EntryChain digest of the original logAfter changing viewer->admin to viewer->viewer in entry 1
12fd2f7cad06fd74cc4049bb57a42544d
2cb7195e6a4483410ddb5913c45a832c4
322e5f72d246e382973ac5e3c70e39a7d

Editing the first line changes every later digest. The chain only helps if a copy of a recent digest sits somewhere the editor cannot reach; otherwise they can recompute the whole chain. Practical measures, drawn from NIST and the OWASP Logging Cheat Sheet:

  • Send entries to a separate system as they are written, so an administrator of the source cannot erase the only copy.
  • Store or copy to read-only or write-once storage where the risk justifies it.
  • Restrict who can read the log, review that list, and record access to the log itself.
  • Alert when logging stops: a silent gap is also a form of tampering.

What to keep out of an audit log

A log that contains secrets becomes a target. The OWASP Logging Cheat Sheet advises that the following should usually be removed, masked, hashed or encrypted instead of written directly:

Do not writeWrite instead
PasswordsNothing; record that a password was changed
Access tokens and API keysA key ID or the last few characters
Session identifiersA hashed value if you need to link events
Sensitive personal data such as health or government identifiersAn internal record ID
Whole request bodies from formsThe names of the fields that changed

Names and IP addresses are often needed for accountability, but they are personal data. Limit them to what the investigation purpose needs; what counts is covered under PII.

Audit logs in TapCub

TapCub keeps an audit log of actions in its own console. It is not a log management or SIEM product for your servers. Take the question in the example, "who raised this person's role, and did anyone export data afterwards?":

  1. Open the log. Go to Configuration › Settings › Audit log. Adding, changing and removing members, turning two-step verification on or off, using a recovery code and changing privacy settings are written there. The groups are members and permissions, site and privacy, data governance, export and login.
  2. Narrow to the group. Check the members and permissions entries for the role change, then the export entries for what followed.
  3. Export for the record. Download CSV, NDJSON or JSON, at most 50,000 rows at a time, and keep it with the incident notes.
  4. Stream a copy elsewhere. The owner or an admin can turn on Real-time audit log push on the same tab: a webhook with a JSON body (with a signing secret, the X-Webhook-Signature header carries an HMAC-SHA256 of the body to verify) or syslog over UDP in RFC 5424 format. A failed push is retried at most twice, so reconcile with an export from time to time.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Su He

Data Analyst

Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is the difference between an audit log and an audit trail?

The words are often used interchangeably. Where a distinction is made, the audit log is the set of recorded entries, and the audit trail is the sequence you can follow through them, sometimes across several systems, to reconstruct how a particular outcome came about.

What should be in an audit log?

NIST SP 800-53 control AU-3 asks for the type of event, when it happened, where, its source, the outcome and the identities involved. In practice record actor, action, target, before and after values, UTC time, source address and success or failure.

How long should audit logs be retained?

There is no single period. NIST SP 800-92 gives examples of 1 to 2 weeks for low-impact, 1 to 3 months for moderate and 3 to 12 months for high-impact systems, only as starting points. Laws, contracts and open investigations can require much longer.

Can audit logs be edited or deleted?

They should be protected against it. NIST control AU-9 requires protection from unauthorized access, modification and deletion, with alerts on detection. Common measures are copies in a separate system, write-once storage, restricted access and digests that reveal changes.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics