Safeguard
Compliance•

What must an application log under PCI DSS requirement 10.2?

PCI DSS 10.2 lists the events audit logs must capture and the fields to record, and 10.5.1 sets retention. A developer checklist to implement it.

Safeguard Security Team
3 min read

PCI DSS 10.2.1 requires audit logs that capture access to cardholder data, administrative actions, access to the logs, invalid access attempts, credential changes, log start and stop events, and creation or deletion of system objects. 10.2.2 sets the fields for each event, and 10.5.1 requires 12 months of history. This is not legal advice.

Events to capture

Per the SAQ D text, audit logs are enabled and active for all system components and cardholder data, and capture:

  1. All individual user access to cardholder data (10.2.1.1).
  2. All actions by anyone with administrative access, including interactive use of application or system accounts (10.2.1.2).
  3. All access to audit logs (10.2.1.3).
  4. All invalid logical access attempts (10.2.1.4).
  5. Changes to identification and authentication credentials, including new accounts, privilege elevation, and changes to admin accounts (10.2.1.5).
  6. Initialization of new audit logs and starting, stopping or pausing of existing ones (10.2.1.6).
  7. Creation and deletion of system-level objects (10.2.1.7).

Fields per event

10.2.2 lists: user identification, type of event, date and time, success or failure indication, origination of event, and the identity or name of the affected data, component, resource or service.

An example record shape

FieldExample value
user_idAn internal ID, not a card number
event_typelogin_failed, admin_role_granted
timestampISO 8601 with time zone
outcomesuccess or failure
sourceIP address or service name
resourceThe record, endpoint or service affected

Never write full card numbers, CVV or other sensitive authentication data into logs. See our post on SAD after authorization. Where PAN must appear, 3.5.1 expects it to be unreadable wherever stored, and the SAQ D text lists audit logs among the places it applies.

Protect and review the logs

NeedRequirement
Limit read access to those with a job-related need10.3.1
Protect from modification10.3.2
Back up promptly to a secure central location10.3.3
File integrity or change detection on logs10.3.4
Review key logs at least daily10.4.1
Keep 12 months, most recent three immediately available10.5.1

Developer checklist

  1. Use one structured logging format across services.
  2. Log security events from the application, not only the infrastructure.
  3. Scrub card data from messages and stack traces.
  4. Ship logs off the host quickly.
  5. Test that an invalid login produces a record.

Quick check

Do I log every read of every record?

10.2.1.1 asks for all individual user access to cardholder data. Scope depends on where that data is, so check with your assessor.

How long must logs be kept?

At least 12 months, with at least the most recent three months immediately available for analysis.

On Safeguard: compliance and evidence automation can collect and retain evidence of controls, though your application logs themselves come from your own systems. Try the free scan at gold.safeguard.sh/scan.

Sources

Wording is from v4.0. Confirm in the current version.

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.