Logging is boring — until it breaks. We migrated to structured JSON logs across services for better parsing and alerting.
Practices that helped:
- Standard keys:
timestamp
, service
, level
, traceId
, message
- Avoid nested structures — simple flat JSONs parse faster
- Mask sensitive fields before loggingToolchain: Logback encoder → Fluent Bit → Elasticsearch
Bonus: enabled JSON parsing in CloudWatch to reduce grep gymnastics.