Why this matters
Enables traceability and forensics while keeping logs actionable.
Log key operations with structured fields (actor/resource/operation) at appropriate levels; include exception info on failures.
Enables traceability and forensics while keeping logs actionable.
Side-by-side examples engineers can pattern-match during review.
logger.info('user updated')logger.info('user_update', extra={'user_id': uid, 'op': 'update', 'status': 'ok'})logger.error('failed')logger.exception('update_failed', extra={'user_id': uid})From the same buckets as this rule.
Never emit Primary Account Number (PAN) or Sensitive Authentication Data (SAD: CVV/CVC, full track data, PIN) to application or audit logs. Per PCI DSS 4.0 Req. 3 and 10, always mask PAN as first6last4 and fully redact SAD before logging.