Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Medium · Free

Why log at INFO/WARN/ERROR? Structured logging basics.

FresherFundamentalsSoftware Engineering & Tools
Model answer

Structured logging

java
logger.info("order_placed", Map.of(
  "orderId", orderId,
  "userId", userId,
  "amount", amount
));
  • INFO normal flow
  • WARN recoverable oddity
  • ERROR needs action
Never log passwords or full PAN.