Why this matters
Structured logs are routable, parsable, and support levels/contexts for observability.
Do not use printStackTrace/System.err; log via a structured logger with context and level.
Structured logs are routable, parsable, and support levels/contexts for observability.
Side-by-side examples engineers can pattern-match during review.
catch (Exception e) { e.printStackTrace(); }catch (Exception e) { logger.error("Payment failed id={}", paymentId, e); }e.printStackTrace()logger.warn("op failed", e)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.